2012

Table Of Contents
Reference Pull-Down or Shortcut Menus
Using a method similar to that used to activate submenus, you can activate
or deactivate another pull-down or shortcut menu. This is called menu
referencing.
Pull-down or shortcut menus can be referenced using two different methods:
relative and absolute. Relative referencing uses the customization group name
and element ID. Absolute referencing uses the absolute position of a menu
item in the menu hierarchy. Relative referencing is recommended because of
its dynamic nature, which allows it to function regardless of the current state
of a menu.
Relative Referencing of Pull-Down and Shortcut Commands
To reference a pull-down or shortcut menu item based on its customization
group and element ID, use the AutoLISP menucmd function. The following
syntax references a menu item based on its element ID.
(menucmd "Gcustomizationgroup.element_id=value")
The following example uses the relative referencing syntax to disable the menu
item ID_Line that is stored in the ACAD customization group. It works regardless
of the menu item's location in the menu.
(menucmd "GACAD.ID_Line=~")
If you know what is contained in the main CUIx file, you can create a partial
CUIx file with an additional menu item that references the main file. In this
manner, partial CUIx files and specific base files can work together.
Absolute Referencing of Pull-Down and Shortcut Menu Items
In addition to referencing a menu item, you can activate or deactivate a menu
item with the $Pn=xxx syntax. This is the format:
$Pn.i=xxx
The $ loads a menu section; Pn specifies the active menu section (0 through
16 are valid values); i specifies the menu item number; and xxx (if present),
specifies a string of grayed out or marked characters.
Using the $Pn=xxx syntax, the following example adds a check mark to item
1 in the POP7 section.
$P7.1=!.
The following example uses the AutoLISP menucmd function to reference a
pull-down or shortcut menu item. Because customization files are dynamic
288 | Chapter 4 User Interface Customization