CAD开发者社区

 找回密码
 立即注册

QQ登录

只需一步,快速开始

ActiveX 开发指南

相关分类

扭曲角度属性 (ActiveX)

2023-1-3 02:35| 发布者: admin| 查看: 185| 评论: 0|来自: AutoCAD

摘要: 指定视区的扭转角度。

指定视区的扭转角度。

支持的平台:仅窗口

签名

工 务 局:

object.TwistAngle
对象

类型:光伏港

此属性适用的对象。

属性值

只读:

类型:

以弧度为单位的扭转角度。

言论

此方法会扭曲或倾斜视线周围的视图。AutoCAD 逆时针测量扭转角度,向右 0 度。

例子

工 务 局:

Sub Example_TwistAngle()
    ' This example creates a new paper space viewport.
    ' It then displays the twist angle of the viewport.
    
    Dim pviewportObj As AcadPViewport
    Dim center(0 To 2) As Double
    Dim width As Double
    Dim height As Double
    
    ' Define the pviewport
    center(0) = 3: center(1) = 3: center(2) = 0
    width = 40
    height = 40
    
    ' Change from model space to paper space
    ThisDrawing.ActiveSpace = acPaperSpace

    ' Create the pviewport
    Set pviewportObj = ThisDrawing.PaperSpace.AddPViewport(center, width, height)
    pviewportObj.Display True
    ThisDrawing.MSpace = True
    ThisDrawing.ActivePViewport = pviewportObj
    ThisDrawing.Regen acAllViewports
    
    ' Find the twist angle for the viewport
    Dim twistAngle As Double
    twistAngle = pviewportObj.TwistAngle
    MsgBox "The twist angle of the paper space viewport is " & pviewportObj.twistAngle, , "TwistAngle Example"

End Sub

Visual LISP:

(vl-load-com)
(defun c:Example_TwistAngle()
    ;; This example creates a new paper space viewport.
    ;; It then displays the twist angle of the viewport.
    (setq acadObj (vlax-get-acad-object))
    (setq doc (vla-get-ActiveDocument acadObj))
    
    ;; Define the pviewport
    (setq center (vlax-3d-point 3 3 0)
          width 40
          height 40)
    
    ;; Change from model space to paper space
    (vla-put-ActiveSpace doc acPaperSpace)

    ;; Create the pviewport
    (setq paperSpace (vla-get-PaperSpace doc))
    (setq pviewportObj (vla-AddPViewport paperSpace center width height))

    (vla-Display pviewportObj :vlax-true)
    (vla-put-MSpace doc :vlax-true)
    (vla-put-ActivePViewport doc pviewportObj)
    (vla-Regen doc acAllViewports)
    
    ;; Find the twist angle for the viewport
    (setq twistAngle (vla-get-TwistAngle pviewportObj))
    (alert (strcat "The twist angle of the paper space viewport is " (rtos twistAngle 2)))
)

路过

雷人

握手

鲜花

鸡蛋

最新评论

QQ|Archiver|CAD开发者社区 ( 苏ICP备2022047690号-1 )

GMT+8, 2024-5-19 15:25

Powered by Discuz! X3.4

Copyright © 2001-2021, Tencent Cloud.

返回顶部