添加给定中心、高度和宽度的图纸空间视口。 支持的平台:仅窗口 签名工 务 局: RetVal = object.AddPViewport(Center, Width, Height)
言论没有额外的评论。 例子工 务 局: Sub Example_AddPViewport() ' This example creates a new paper space 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) ThisDrawing.Regen acAllViewports End Sub Visual LISP: (vl-load-com) (defun c:Example_AddPViewport() ;; This example creates a new paper space 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)) ;; Turn the viewport on, by default it is off (vla-Display pviewportObj :vlax-true) (vla-Regen doc acAllViewports) ) |
|Archiver|CAD开发者社区 ( 苏ICP备2022047690号-1 苏公网安备32011402011833)
GMT+8, 2025-1-8 19:45
Powered by Discuz! X3.4
Copyright © 2001-2021, Tencent Cloud.