WTYLMF 发表于 2005-2-24 10:40:00

Mccad老师:请教SendCommand的详细用法

Mccad老师:



                                               感谢您对我以前的问题的回答。请问您有SendCommand函数的用法的详细说明吗?

clement 发表于 2005-2-24 10:42:00

看帮助,按F1

WTYLMF 发表于 2005-2-24 11:31:00

谢谢!语法是很简单的,详细用法就很复杂。

clement 发表于 2005-2-24 15:10:00

<PRE class=Code>这个函数没有什么复杂的地方啊,而且除非没有对应的Method,尽量不要用。</PRE><PRE class=Code>Sub Example_SendCommand()
   ' This example sends a command to the AutoCAD commandline
   ' of a particular drawing for evaluation
   
   ' We will create a Circle in the active drawing and will
   ' zoom to display the entire circle
   ThisDrawing.SendCommand "_Circle" &amp; vbCr &amp; "2,2,0" &amp; vbCr &amp; "4" &amp; vbCr
   ThisDrawing.SendCommand "_zoom" &amp; vbCr &amp; "a" &amp; vbCr
   
   ' Refresh view
   ThisDrawing.Regen acAllViewports
   
   MsgBox "A circle command has been sent to the command line of the current drawing."
End Sub</PRE>

WTYLMF 发表于 2005-2-24 15:24:00

谢谢!再问复杂一点。例如:通过SendCommand实现‘插入OLE对象’。


怎么办?(ThisDrawing.SendCommand "_InsertObj" &amp; vbCr        ????)

clement 发表于 2005-2-24 16:54:00

InsertObj可是有用户界面的,不是单纯在命令行敲命令就能实现的。


SendCommand的功能就是代替在命令行敲命令,用它恐怕实现不了这个功能。

WTYLMF 发表于 2005-2-24 17:24:00

有其他可以替代的手段吗?我想给Cad窗口发送消息应该是可以实现的吧?
页: [1]
查看完整版本: Mccad老师:请教SendCommand的详细用法