simengliu 发表于 2005-8-7 11:54:00

问:为什么这个命令调用不了?

<P>当对CommandMethod属性采用四个参数调用时,在AutoCAD2006中无法调用,代码如下:</P>
<P>using System ;<BR>using Autodesk.AutoCAD.Runtime ;<BR>using Autodesk.AutoCAD.EditorInput;<BR>using Autodesk.AutoCAD.ApplicationServices;</P>
<P></P>
<P>namespace ClassLibrary<BR>{<BR>&nbsp;/// &lt;summary&gt;<BR>&nbsp;/// Summary description for LSMClass.<BR>&nbsp;/// &lt;/summary&gt;<BR>&nbsp;public class LSMClass<BR>&nbsp;{<BR>&nbsp;&nbsp;public LSMClass()<BR>&nbsp;&nbsp;{</P>
<P>&nbsp;&nbsp;}</P>
<P>&nbsp;&nbsp;// Define Command "AsdkCmd1"<BR>&nbsp;&nbsp;<BR>&nbsp;&nbsp;static public void test() // This method can have any name<BR>&nbsp;&nbsp;{<BR>&nbsp;&nbsp;&nbsp;Editor ed = Application.DocumentManager.MdiActiveDocument.Editor;<BR>&nbsp;&nbsp;&nbsp;ed.WriteMessage("\nHello World");&nbsp;&nbsp;&nbsp;// Put your command code here<BR>&nbsp;&nbsp;}</P>
<P>&nbsp;}<BR>}</P>

<P>个中缘由,请大家助我!</P>
<P>谢谢!</P>
页: [1]
查看完整版本: 问:为什么这个命令调用不了?