我最近编了一些小程序,但是通过运行宏,或者创建下拉菜单的方式运行,不是很方便,请问各位高手,如何为程序创建命令。比如CAD里要画一条直线,在命令行里输入 L 便可以运行了,假如有如下简单程序:
<RE class=Code>Sub MyLine()
' This example adds a line in model space
Dim lineObj As AcadLine
Dim startPoint(0 To 2) As Double
Dim endPoint(0 To 2) As Double
' Define the start and end points for the line
startPoint(0) = 1#: startPoint(1) = 1#: startPoint(2) = 0#
endPoint(0) = 5#: endPoint(1) = 5#: endPoint(2) = 0#
' Create the line in model space
Set lineObj = ThisDrawing.ModelSpace.AddLine(startPoint, endPoint)
ZoomAll
End Sub</PRE><RE class=Code>我想在命令行输入ML 就能运行起这个程序,请问怎么办?</PRE><RE class=Code>如有那位大哥指教,在下感激不尽!</PRE>