关于拆分活动视口 (ActiveX)
可以使用该方法将活动视口拆分为多个视口。Split
此方法采用一个参数,即要将视口拆分为的配置类型。若要指定窗口配置,请使用与前面显示的默认配置相对应的以下常量之一:、、、或 。acViewport2HorizontalacViewport2VerticalacViewport3LeftacViewport3RightacViewport3HorizontalacViewport3VerticalacViewport3AboveacViewport3BelowacViewport4
将视口拆分为两个水平窗口
下面的示例创建一个新的视口,然后将该视口拆分为两个水平窗口。
- AutoLISP
-
(vl-load-com)
(defun c:Ch3_SplitAViewport()
(setq acadObj (vlax-get-acad-object)
doc (vla-get-ActiveDocument acadObj))
;; Create a new viewport
(setq viewportsCollection (vla-get-Viewports doc)
vportObj (vla-Add viewportsCollection "TEST_VIEWPORT"))
;; Split vportObj into 2 horizontal windows
(vla-Split vportObj acViewport2Horizontal)
;; Now set vportObj to be the active viewport
(vla-put-ActiveViewport doc vportObj)
)
- VBA(仅限 AutoCAD)
-
Sub Ch3_SplitAViewport()
' Create a new viewport
Dim vportObj As AcadViewport
Set vportObj = ThisDrawing.Viewports.Add("TEST_VIEWPORT")
' Split vportObj into 2 horizontal windows
vportObj.Split acViewport2Horizontal
' Now set vportObj to be the active viewport
ThisDrawing.ActiveViewport = vportObj
End Sub
|