Back HomeBack to DocumentsBack to D-I-E-S-E-LYou are here
Some useful DIESEL macros


Some useful DIESEL macros

VG-Wort Access-ZählmarkeYou may add talking menu labels to your pull-down menus. Then you can easily see the necessary settings without having to call the appropiate commands. Here's an example:

[$(eval,Fillet radius <$(rtos,$(getvar,filletrad))>)]+
'filletrad;

System variables which only have an on/off setting, may display a checkmark to show the current value. This macro combines two settings:

[$(if,$(getvar,snapmode),!.)Snap spacing <$(rtos,$(index,0,$(getvar,snapunit))),$(rtos,$(index,1,$(getvar,snapunit)))>]+
'_snap;

An if statement in the macro code can be used to change a variable from on to off and vice versa:

[$(if,$(getvar,tilemode),!.)Tilemode]+
^C^Ctilemode;$M=$(if,$(getvar,tilemode),0,1);

Often menu macros should act differently depending on the active command. The CMDNAMES variable can be used to detect the running command, if any. This macro checks whether any command is active. If not, it turns the running osnap off. If a command is active, the running osnap is overwritten by "none" for the next input only:

[OSnap off]+
$M=$(if,$(eq,,$(getvar,cmdnames)),+
'osmode;0,_none)

In a similar way you can turn on or override any running object snap mode. Use the and and xor functions to evaluate the OSMODE system variable:

[$(if,$(and,1,$(getvar,osmode)),!.)Endpoint snap]+
$M=$(if,$(eq,,$(getvar,cmdnames)),+
'osmode;$(xor,1,$(getvar,osmode)),_end)
[$(if,$(and,2,$(getvar,osmode)),!.)Midpoint snap]+
$M=$(if,$(eq,,$(getvar,cmdnames)),+
'osmode;$(xor,2,$(getvar,osmode)),_mid)
[$(if,$(and,4,$(getvar,osmode)),!.)Center snap]+
$M=$(if,$(eq,,$(getvar,cmdnames)),+
'osmode;$(xor,4,$(getvar,osmode)),_cen)

This is a shareware document. What is a shareware document? Did this article help you earn some money? Then give something back! Help creating shareware documents by donating something to the author:


Contact CR/LF GmbH

© 2000-2011 by CR/LF GmbH, Essen/Germany. All rights reserved.
No part of this document may be reproduced or published without written consent by CR/LF GmbH.
Last modification: 01.04.2011