Untitled

(Steven Felgate) #1
The format is:

$M=expression

Introducing the macro with $M= tells AutoCAD LT to evaluate a string as a
DIESEL expression, and that expression is the DIESEL expression. The
following example defines a conditional expression in a macro:

FILLMODE$M=$(-,1,$(getvar,fillmode))

The macro switches the FILLMODE system variable on and off by subtracting
the current value of FILLMODE from 1 and returning the resulting value to
the FILLMODE system variable. You can use this method to toggle system
variables whose valid values are 1 or 0.

Termination of Macros That Contain Conditional Expressions

If you use the DIESEL string language to perform “if-then” tests, conditions
might exist where you do not want the normal terminating space or semicolon
(resulting in ENTER). If you add ^Z to the end of the macro, AutoCAD LT does
not automatically add a space (ENTER) to the end of the macro expression.

As with other control characters in commands, the ^Z used here is a string
composed of ^ (a caret) and Zand is not equivalent to pressing Ctrl+Z.

In the following examples, ^Z is used as a macro terminator.

^C^C$M=$(if,$(=,$(getvar,tilemode),0),$S=mview_mspace)^Z
^C^C$M=$(if,$(=,$(getvar,tilemode),0),$S=mview_pspace)^Z

If these macros did not end with ^Z, AutoCAD LT would automatically add a
space (ENTER), repeating the last command entered.

See also:

■ Use Special Control Characters in Macros on page 104

■ DIESEL on page 325

Quick Reference


Commands

CUI

Manages the customized user interface elements in the product.

112 | Chapter 4 User Interface Customization

Free download pdf