wycl8 发表于 2007-11-18 08:53:00

[求助]用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>

王咣生 发表于 2007-11-18 20:45:00

<p>(setq ce (getvar "CMDECHO"))</p><p>(setvar "CMDECHO" 0)</p><p>;...调用宏</p><p>(setvar "CMDECHO" ce)</p><p>(princ)</p>

qtds3386 发表于 2008-2-10 21:50:00

看了,非常好,真的很感谢啊

雪山飞狐_lzh 发表于 2008-2-10 22:46:00

(vla-runmacro<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; (vlax-get-acad-object)<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 宏名<br/>&nbsp;&nbsp;&nbsp; )<br/>

qtds3386 发表于 2008-2-12 06:39:00

<p>(defun c:pmfh()<br/>&nbsp;&nbsp; (setq ce (getvar "CMDECHO"))<br/>&nbsp;&nbsp; (setvar "CMDECHO" 0)<br/>&nbsp;&nbsp; (command "_-vbarun" "dytzh")<br/>&nbsp;&nbsp; (setvar "CMDECHO" ce)<br/>(princ)<br/>);程序结束</p><p>;这样写可以,效果很好</p><p>(defun c:pmfh()<br/>&nbsp;&nbsp; (vla-runmacro<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; (vlax-get-acad-object)<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; dytzh<br/>&nbsp;&nbsp; )<br/>(princ)<br/>);程序结束<br/></p><p>;这样写出错(no function definition: VLAX-GET-ACAD-OBJECT)</p>

yshf 发表于 2008-2-17 12:06:00

<p>改为如下:</p><p>(defun c:pmfh()</p><p>&nbsp;&nbsp; (vl-load-com)&nbsp;&nbsp;&nbsp;<br/>&nbsp;&nbsp; (vla-runmacro<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; (vlax-get-acad-object)<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; dytzh<br/>&nbsp;&nbsp; )<br/>(princ)<br/>);程序结束<br/></p>
页: [1]
查看完整版本: [求助]用lisp调用VBA命令