CAD开发者社区

 找回密码
 立即注册

QQ登录

只需一步,快速开始

ActiveX 开发指南

相关分类

显示方法 (ActiveX)

2023-1-4 10:48| 发布者: admin| 查看: 662| 评论: 0|来自: AutoCAD

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

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

支持的平台:仅窗口

签名

工 务 局:

object.Display Status
对象

类型:光伏港

此方法适用的对象。

地位

访问:仅输入

类型:布尔

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

返回值(RetVal)

无返回值。

言论

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

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

例子

工 务 局:

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

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

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

Powered by Discuz! X3.4

Copyright © 2001-2021, Tencent Cloud.

返回顶部