The AutoCADET's Guide to Visual LISP: Optimize and Customize Your AutoCAD Design Environment

The input system discussed thus far is based on the operator selecting objects from the drawing, typing data, or interacting with a dialog box. But AutoCAD has much more: menus across the top, sidebar menus, pop-up menus, toolbar icons, the text screen, and the graphics display. Each can be controlled by Visual LISP programs. In addition, operating-system-level interfaces are provided because AutoCAD runs in a Windows environment. Visual LISP programmers can exploit ActiveX automation tools from other environments. This provides plenty of power for even the most demanding applications.
In this chapter, you look at the AutoCAD menu system as seen from the Visual LISP programming perspective and learn how to interface Visual LISP to ActiveX server systems. By controlling the display system and menu contents, you provide operators with guidance that is less intrusive than a dialog box.
Most operators begin customizing AutoCAD through the menu system. By changing the layout of the menu system, you can have a significant effect on productivity. And because Visual LISP integrates well with the menu system, advanced control of the interface is possible.
When looking at menus in relation to Visual LISP, the first place to start is with the loading functions. You can initiate your functions with a simple expression structure. Use a ^C sequence to cancel any existing commands followed by ^P to turn off the echo of the menu to the command line. Then use an IF expression to test the function name...