03.01.2013 Views

Customization Guide (.pdf) - Documentation & Online Help - Autodesk

Customization Guide (.pdf) - Documentation & Online Help - Autodesk

Customization Guide (.pdf) - Documentation & Online Help - Autodesk

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

The format is:<br />

$M=expression<br />

Introducing the macro with $M= tells AutoCAD LT to evaluate a string as a<br />

DIESEL expression, and that expression is the DIESEL expression. The<br />

following example defines a conditional expression in a macro:<br />

FILLMODE $M=$(-,1,$(getvar,fillmode))<br />

The macro switches the FILLMODE system variable on and off by subtracting<br />

the current value of FILLMODE from 1 and returning the resulting value to<br />

the FILLMODE system variable. You can use this method to toggle system<br />

variables whose valid values are 1 or 0.<br />

Termination of Macros That Contain Conditional Expressions<br />

If you use the DIESEL string language to perform “if-then” tests, conditions<br />

might exist where you do not want the normal terminating space or semicolon<br />

(resulting in ENTER). If you add ^Z to the end of the macro, AutoCAD LT does<br />

not automatically add a space (ENTER) to the end of the macro expression.<br />

As with other control characters in commands, the ^Z used here is a string<br />

composed of ^ (a caret) and Z and is not equivalent to pressing Ctrl+Z.<br />

In the following examples, ^Z is used as a macro terminator.<br />

^C^C$M=$(if,$(=,$(getvar,tilemode),0),$S=mview _mspace )^Z<br />

^C^C$M=$(if,$(=,$(getvar,tilemode),0),$S=mview _pspace )^Z<br />

If these macros did not end with ^Z, AutoCAD LT would automatically add a<br />

space (ENTER), repeating the last command entered.<br />

See also:<br />

■ Use Special Control Characters in Macros on page 104<br />

■ DIESEL on page 325<br />

Quick Reference<br />

Commands<br />

CUI<br />

Manages the customized user interface elements in the product.<br />

112 | Chapter 4 User Interface <strong>Customization</strong>

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!