Using AutoLISP for Keyboard Macros

Many of the most useful AutoLISP macros are as simple as C:ZO, which was defined in the previous section. Other macros, although performing more involved tasks, are extensions of the simple macro model represented by C:ZO. An AutoLISP macro, for example, may call a series of commands as shown later in this section, start a command or provide predetermined responses to one or more command prompts that allow the user to finish the command sequence interactively.

The following is an example of an AutoLISP macro that calls more than one AutoCAD command:

 (defun C:RX () 
  (command "UCS""X""90") 
  (command "PLAN" "C") 
) 

This macro, C:RX, could be useful in 3D work. It first rotates the UCS about the X-axis by 90 degrees. ...

Get Inside AutoCAD® 2002 now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.