一些有用的DIESEL宏

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)

猜你喜欢

转载自blog.csdn.net/pilifeng1/article/details/82344338
今日推荐