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

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

to the function's definition. DIESEL macro expressions have only one data<br />

type: strings. Macros that operate on numbers express the numbers as strings<br />

and convert back and forth as required.<br />

For descriptions of the DIESEL functions, see Catalog of DIESEL Functions on<br />

page 331.<br />

Now define a more interesting status line (for example, one that shows the<br />

current text style name):<br />

Command: modemacro<br />

New value for MODEMACRO, or . for none : Style: $(getvar, textstyle)<br />

■ Style: is a text string to be displayed on the status line.<br />

■ $(getvar,textstyle) is a DIESEL function (getvar) and argument that<br />

retrieves the current value of the TEXTSTYLE system variable.<br />

NOTE The examples in this topic may show the MODEMACRO string as more<br />

than one line of text. You enter it as one long string at the prompt.<br />

You can retrieve any system variable by entering $(getvar, varname). The<br />

current setting of the system variable replaces the macro expression on the<br />

status line. Then, when you switch text styles, for example, MODEMACRO is<br />

reevaluated. If it changes, the new text style name is displayed on the status<br />

line.<br />

Expressions can be nested, and they can be as complex as you want. The<br />

example that follows displays the current snap value and angle (in degrees)<br />

in the status line. It uses nested expressions to convert the snap angle from<br />

radians to degrees and truncates the value to an integer.<br />

Command: modemacro<br />

New value for MODEMACRO, or . for none : Snap: $(getvar, snapunit)<br />

$(fix,$(*,$(getvar,snapang),$(/,180,3.14159)))<br />

You can also display the values in the current linear and angular units modes.<br />

Command: modemacro<br />

New value for MODEMACRO, or . for none : Snap: $(rtos,$(index,0,<br />

$(getvar,snapunit))),$(rtos,$(index,1,$(getvar,snapunit))) $(angtos,<br />

$(getvar,snapang))<br />

DIESEL copies its input directly to the output until it comes to the dollar sign<br />

character ($) or a quoted string. You can use quoted strings to suppress<br />

evaluation of character sequences that would otherwise be interpreted as<br />

DIESEL functions. You can include quotation marks in quoted strings by using<br />

Set MODEMACRO Values | 327

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

Saved successfully!

Ooh no, something went wrong!