TwistAngle プロパティ(ActiveX)

ビューポートの傾斜角度を指定します。

サポートされているプラットフォーム: Windows のみ

構文と要素

VBA:

object.TwistAngle
object

タイプ: PViewport

このプロパティが適用されるオブジェクト。

プロパティの値

読み込み専用: いいえ

タイプ: 倍精度浮動小数点数型

傾斜角度はラジアンで表します

注意

これは、視線の周りにビューをひねる、つまり傾けるメソッドです。AutoCAD では、傾斜角度を反時計回りに、0°が右になるように計ります。

VBA:

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)))
)