兰州人 发表于 2006-11-14 15:48:00

在VB中如何使用ThisDrawing.SendCommand

<P><FONT size=2>在autocad的VBA中可以使用ThisDrawing.SendCommand指令</FONT></P>
<P><FONT size=2>ThisDrawing.SendCommand "_UCS" &amp; vbCr &amp; "y" &amp; vbCr &amp; ""</FONT></P>
<P><FONT size=2>问:</FONT></P>
<P><FONT size=2>在VB中,这条语句如何改??</FONT></P>
<P><FONT size=2>???+SendCommand "_UCS" &amp; vbCr &amp; "y" &amp; vbCr &amp; ""就能实现上述语句的功能.</FONT></P>
<P><FONT size=2>谢谢</FONT></P>

gdzhou 发表于 2006-11-14 17:21:00

<P>On Error Resume Next<BR>Dim acadapp As AcadApplication<BR>Set acadapp = GetObject(, "autocad.application")<BR>If Err Then<BR>&nbsp;&nbsp;&nbsp; Err.Clear<BR>&nbsp;&nbsp;&nbsp; Set acadapp = CreateObject("autocad.application")<BR>&nbsp;&nbsp;&nbsp; acadapp.Visible = True<BR>&nbsp;&nbsp;&nbsp; If Err Then<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; MsgBox Err.Description<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Exit Sub<BR>&nbsp;&nbsp;&nbsp; End If<BR>End If<BR>Dim acaddoc As AcadDocument<BR>Set acaddoc = acadapp.ActiveDocument</P>
<P>acaddoc.sendcommand <FONT size=2>"_UCS" &amp; vbCr &amp; "y" &amp; vbCr &amp; ""</FONT></P>

兰州人 发表于 2006-11-14 17:29:00

谢谢,我会按你的思路试一下。
页: [1]
查看完整版本: 在VB中如何使用ThisDrawing.SendCommand