lelfei 发表于 2008-4-23 12:05:00

在VBA里如何实现快速命令?

<p>如题,在LISP里实现起来很容易,用“c:function name”就能做快速命令,在VBA里要如何实现?</p><p>在帮助里没找到,但是发现用VALX类可以实现执行LISP语句,在LISP里再嵌套VBA函数这样是否可行?</p>

lelfei 发表于 2008-4-24 18:46:00

哪位 大大头注一下。。。

azjmjsj 发表于 2008-4-25 00:29:00

<p>Private Sub addcommand()<br/>ThisDrawing.SendCommand "(defun C:AZJ() (command " &amp; Chr(34) &amp; "-vbarun" &amp; Chr(34) &amp; Chr(32) &amp; Chr(34) &amp; "azjmjsj" &amp; Chr(34) &amp; "))" &amp; Chr(32)<br/>ThisDrawing.SendCommand "(defun C:ABC() (command " &amp; Chr(34) &amp; "-vbarun" &amp; Chr(34) &amp; Chr(32) &amp; Chr(34) &amp; "abcde" &amp; Chr(34) &amp; "))" &amp; Chr(32)<br/>End Sub</p><p>Private Sub AcadDocument_BeginCommand(ByVal CommandName As String)<br/>If StrComp(Left$(CommandName, 3), "VBA", 1) &lt;&gt; 0 And UCase$(CommandName) &lt;&gt; "APPLOAD" Then Exit Sub<br/>addcommand<br/>End Sub</p><p>Private Sub AcadDocument_EndCommand(ByVal CommandName As String)<br/>If StrComp(Left$(CommandName, 3), "VBA", 1) &lt;&gt; 0 And UCase$(CommandName) &lt;&gt; "APPLOAD" Then Exit Sub<br/>addcommand<br/>End Sub</p><p>****************************************************************************<br/>西北凡人: http://www.abofanyi.com/blog</p>

lelfei 发表于 2008-4-29 20:34:00

感谢楼上的提供!我试试先!

mccad 发表于 2008-4-29 21:43:00

没有看到置顶的贴子吗?
页: [1]
查看完整版本: 在VBA里如何实现快速命令?