LensLength プロパティ(ActiveX)

パース ビューで使用されるレンズ長を指定します。

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

構文と要素

VBA:

object.LensLength
object

タイプ: PViewport

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

プロパティの値

読み込み専用: いいえ

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

レンズの長さ(mm)。

注意

注: このプロパティの値は、システム変数 LENSLENGTH に格納されます。

VBA:

Sub Example_LensLength()
    ' This example creates a new paper space viewport.
    ' It then displays the lens length of the viewport.
    
    Dim pviewportObj As AcadPViewport
    Dim center(0 To 2) As Double
    Dim width As Double
    Dim height As Double
    
    ' Define the paper space viewport
    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 paper space viewport
    Set pviewportObj = ThisDrawing.PaperSpace.AddPViewport(center, width, height)
    pviewportObj.DISPLAY True
    ThisDrawing.mspace = True
    ThisDrawing.ActivePViewport = pviewportObj
    ThisDrawing.Regen acAllViewports
    
    ' Find the Lens Length for the viewport
    Dim lenslgnth As Double
    lenslgnth = pviewportObj.LensLength
    MsgBox "The lens length of the paperspace viewport is " & pviewportObj.LensLength, , "LensLength Example"

End Sub

Visual LISP:

(vl-load-com)
(defun c:Example_LensLength()
    ;; This example creates a new paper space viewport.
    ;; It then displays the lens length of the viewport.
    (setq acadObj (vlax-get-acad-object))
    (setq doc (vla-get-ActiveDocument acadObj))
  
    ;; Define the paper space viewport
    (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 paper space viewport
    (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 Lens Length for the viewport
    (setq lenslgnth (vla-get-LensLength pviewportObj))
    (alert (strcat "The lens length of the paperspace viewport is " (rtos lenslgnth 2)))
)