这里有几个线程涉及这一点,但并不完全是我所追求的。
下面的代码用于使用当前ucs设置基本视图,我现在要做的是打开修剪平面。
到目前为止,我已经找到了可以用位掩码切换的sysvar VIEWMODE,这是失败的,有什么想法吗?
下一个问题将是设置剪辑距离,有没有人使用arx dll的函数有任何运气?
- Public Sub SetClippedView()
- ' This example creates a new view.
- ' It then changes the active viewport to
- ' the newly created view.
-
- ' Create a new view
- Dim viewObj As AcadView
- Set viewObj = ThisDrawing.Views.Add("TESTVIEW")
-
- ' Set the view characteristics
- ' get the current ucs values:
- Dim xdir As Variant, ydir As Variant, zdir(2) As Double, ucsorigin As Variant
- xdir = ThisDrawing.GetVariable("UCSXDIR")
- ydir = ThisDrawing.GetVariable("UCSYDIR")
- 'cross the x and y vecs to get the zdir
- Dim xv(2) As Double, yv(2) As Double
- InitVec xv, xdir: InitVec yv, ydir
- VecCross zdir, xv, yv
- ucsorigin = ThisDrawing.GetVariable("UCSORG")
- viewObj.Center(0) = ucsorigin(0): viewObj.Center(1) = ucsorigin(1)
- viewObj.Direction = zdir
- viewObj.Target = ucsorigin
- 'set the clipping planes on:
- ThisDrawing.SetVariable "VIEWMODE", 6 '<<-------- fails here
-
- ' Get the current active viewport
- Dim viewportObj As AcadViewport
- Set viewportObj = ThisDrawing.ActiveViewport
-
- ' Set the view in the viewport
- viewportObj.SetView viewObj
- ThisDrawing.ActiveViewport = viewportObj
-
- ThisDrawing.Regen True
- ThisDrawing.SendCommand "_zoom" & vbCr & "a" & vbCr
- End Sub
本帖以下内容被隐藏保护;需要你回复后,才能看到! 游客,如果您要查看本帖隐藏内容请 回复 |