xujian8498 发表于 2006-6-13 08:51:00

在VBA中如何实现AutoCAD中UCS_V(视图)功能?

<P>在VBA中如何实现AutoCAD中UCS_V(视图)功能?</P>
<P>其要求是,先画好立体图,再转成视图写字等。衷心感谢!</P>

xinghesnak 发表于 2006-6-13 09:12:00

Dim str As String<BR>ThisDrawing.SetVariable "cmddia", 0<BR>str = "AMDWGVIEW" &amp; vbCr &amp; vbCr &amp; vbCr &amp; vbCr &amp; vbCr &amp; "V" &amp; vbCr &amp; vbCr &amp; "0,0,0" &amp; vbCr &amp; vbCr<BR>ThisDrawing.SendCommand str<BR>ThisDrawing.SetVariable "cmddia", 1<BR>ThisDrawing.Application.ZoomAll

xujian8498 发表于 2006-6-13 17:20:00

<P>谢谢!我也试成了一种办法,程序如下:</P>
<P>' 设置当前的坐标系为世界坐标系<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ThisDrawing.SendCommand "_ucs "<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Utilobj.CreateTypedArray direction, vbDouble, -1, -1, 1<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ThisDrawing.ActiveViewport.direction = direction<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ThisDrawing.ActiveViewport = ThisDrawing.ActiveViewport<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ThisDrawing.SendCommand "ucs" &amp; vbCr &amp; "w "<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ThisDrawing.SendCommand "ucs" &amp; vbCr &amp; "v "</P>
<P>ZoomAll</P>
<P>&nbsp;</P>
页: [1]
查看完整版本: 在VBA中如何实现AutoCAD中UCS_V(视图)功能?