[求助]用lisp调用VBA命令
本帖最后由 作者 于 2007-11-18 8:55:18 编辑 <br /><br /> <p>用lisp调用VBA命令,并不在CAD中显示Macro name:这行,</p><p>Lisp能不能办到呀!</p><p>即虽为VBA,就像LISP编的命令一样,不出现宏的字样。</p><p>请各位指教!先谢谢了!</p> <p>(setq ce (getvar "CMDECHO"))</p><p>(setvar "CMDECHO" 0)</p><p>;...调用宏</p><p>(setvar "CMDECHO" ce)</p><p>(princ)</p> 看了,非常好,真的很感谢啊 (vla-runmacro<br/> (vlax-get-acad-object)<br/> 宏名<br/> )<br/> <p>(defun c:pmfh()<br/> (setq ce (getvar "CMDECHO"))<br/> (setvar "CMDECHO" 0)<br/> (command "_-vbarun" "dytzh")<br/> (setvar "CMDECHO" ce)<br/>(princ)<br/>);程序结束</p><p>;这样写可以,效果很好</p><p>(defun c:pmfh()<br/> (vla-runmacro<br/> (vlax-get-acad-object)<br/> dytzh<br/> )<br/>(princ)<br/>);程序结束<br/></p><p>;这样写出错(no function definition: VLAX-GET-ACAD-OBJECT)</p> <p>改为如下:</p><p>(defun c:pmfh()</p><p> (vl-load-com) <br/> (vla-runmacro<br/> (vlax-get-acad-object)<br/> dytzh<br/> )<br/>(princ)<br/>);程序结束<br/></p>
页:
[1]