一些有用的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)
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值