AutoCAD 2002 Bible

Скачать в pdf «AutoCAD 2002 Bible»


You can create two kinds of context-sensitive menus — object menus and command menus. The context-sensitive menus work only for full menus.


Object menus


The Edit mode shortcut menu appears when you right-click in the drawing area when one or more objects are selected but no command is active, as shown in Figure 33-9.


You can create object menus that are specific to a type of object. You might want to add certain commands that you use often with that type of object. The commands that you add to an object menu are appended to the Edit mode shortcut menu so that the result is a menu that contains the Edit mode shortcut menu plus any additional commands that you have added for that type of object.

Figure 33-9: The Edit mode shortcut menu


To create an object menu, you must name the menu either OBJECT_objectname, used when one object of a type is selected, or OBJECTS_objectname, used when more than one object of a type is selected. The object name is the DXF name of the object. (Two exceptions exist — use BLOCKREF for a block insertion and XREF for an xref.) To find out the object name of an object, type the following on the command line:


(cdr (assoc 0 (entget (car (entsel))))) J


That’s five closing parentheses at the end. AutoCAD then prompts you to select an object. Once you do, you see the object’s name on the command line.


Cross-    See Chapters 34 and 35, which cover AutoLISP and Visual LISP, for an explanation

Скачать в pdf «AutoCAD 2002 Bible»