2011

Table Of Contents
DIESEL
Because DIESEL expressions handle strings exclusively, the USERS1-5 system variables are
useful for passing information from an AutoLISP routine to a DIESEL expression. DIESEL
expressions are evaluated by AutoLISP routines through the use of the AutoLISP menucmd
function.
DIESEL Expressions in Macros
You can use DIESEL string expressions in customization (CUI) files as an
additional method of creating macros.
These expressions can return string values (text strings) in response to standard
AutoCAD for Mac commands, AutoLISP and ObjectARX
®
routines, and other
macros. They can also return string values to the menu itself, thereby altering
the appearance or content of a menu label.
A DIESEL expression that you use in a menu item must follow the
$section=submenu format where the section name is M and the submenu is the
DIESEL expression you want. Frequently, you can implement a macro more
easily with AutoLISP.
The following examples show two menu items that produce the same result;
one uses DIESEL, and the other uses AutoLISP.
This menu item uses the DIESEL expression:
^C^C^P$M=$(if,$(=,$(getvar,cvport),1),mspace,pspace)
This menu item uses the AutoLISP expression:
^C^C^P(if (= (getvar "cvport") 1)(command "mspace")+
(command "pspace"))(princ) ^P
Both menu items provide a way to switch between paper space and model space
(if TILEMODE is set to 0), but the DIESEL expression is shorter and is evaluated
5
71