CAD开发者社区

 找回密码
 立即注册

QQ登录

只需一步,快速开始

AutoCAD 2020 开发者帮助

Display 方法 (ActiveX)

2024-5-18 18:20| 发布者: admin| 查看: 107| 评论: 0|原作者: admin|来自: AutoCAD

Display 方法 (ActiveX)

打开或关闭 PViewport 对象的显示控件。

支持的平台:仅限 Windows

签名

VBA:

object.Display Status
对象

类型: PViewport

此方法应用到的对象。

地位

访问:仅输入

类型:布尔

  • True:视口显示已打开。
  • False:视口显示已关闭。

返回值 (RetVal)

无返回值。

言论

显示控件必须处于打开状态,然后才能使用该属性激活模型空间编辑功能。MSpace

使用该属性可确定是否已使用此方法打开纸张空间视口显示。ViewportOn

例子

VBA:

Sub Example_DisplayMethod()
    ' This example creates a paper space viewport and makes it active.
    
    Dim newPViewport As AcadPViewport
    Dim centerPoint(0 To 2) As Double
    Dim height As Double
    Dim width As Double
    height = 30#
    width = 40#
    centerPoint(0) = 30#: centerPoint(1) = 30#: centerPoint(2) = 0#
    
    ' Create a paper space Viewport object
    ThisDrawing.ActiveSpace = acPaperSpace
    Set newPViewport = ThisDrawing.PaperSpace.AddPViewport(centerPoint, width, height)
    ZoomAll
    newPViewport.Display True
    
    ' Before making a pViewport active,
    ' the mspace property needs to be True
    ThisDrawing.mspace = True
    ThisDrawing.ActivePViewport = newPViewport
End Sub

可视化 LISP:

(vl-load-com)
(defun c:Example_DisplayMethod()
    ;; This example creates a paper space viewport and makes it active.
    (setq acadObj (vlax-get-acad-object))
    (setq doc (vla-get-ActiveDocument acadObj))
  
    (setq centerPoint (vlax-3d-point 30 30 0)
          height 30
          width 40)
    
    ;; Create a paper space Viewport object
    (vla-put-ActiveSpace doc acPaperSpace)
    (setq newPViewport (vla-AddPViewport (vla-get-PaperSpace doc) centerPoint width height))
    (vla-ZoomAll acadObj)
    (vla-Display newPViewport :vlax-true)
    
    ;; Before making a pViewport active,
    ;; the mspace property needs to be True
    (vla-put-MSpace doc :vlax-true)
    (vla-put-ActivePViewport doc newPViewport)
)

路过

雷人

握手

鲜花

鸡蛋

最新评论

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

GMT+8, 2024-12-15 13:15

Powered by Discuz! X3.4

Copyright © 2001-2021, Tencent Cloud.

返回顶部