harinezumi Posted June 19, 2019 Posted June 19, 2019 Hi, I have some variables wich I sometimes need to toggle, so I made my menu commands. I managed to create a command to show the current value and another to actually toggle it. Is there a way to merge the two? like showing the command "turn frameselction ON" (or OFF based on current value)? Here are my commands: toggle snap to hatch command to show current value (Command Name line in the CUI) ~Current snap to hatch: $(index,$(getvar, osnaphatch),"off,on") command to toggle (Command Macro line in the CUI) 'osnaphatch $M=$(xor,$(getvar, osnaphatch),1) and similarly for "frameselection" I hate the need to have two separate lines in the menu. Thank you Quote
steven-g Posted June 19, 2019 Posted June 19, 2019 I think you will have to live with it. Adding the tilde to the command name disables it so it can't contain the toggle macro, and removing the tilde stops the label diesel from working and turns into text. Quote
steven-g Posted June 19, 2019 Posted June 19, 2019 (edited) Wouldn't you know it, post a negative answer then 2 minutes later you find the solution, try this in the command name section $(index,$(getvar, osnaphatch),"Current snap to hatch: off,Current snap to hatch: on") And place your other code in the macro section. PS nice idea, I'll be adding a few of these myself Edited June 19, 2019 by steven-g 1 Quote
tombu Posted June 24, 2019 Posted June 24, 2019 A Display Name of $(if,$(and,1,$(getvar,ossnaphatch)),!.)OsnapHatch displays highlighted when on. Simple and easy alternative for displaying whether a system variable is On -vs- Off. For newer versions the proper macro would be ^P'setvar;osoptions;$M=$(if,$(and,1,$(getvar,osoptions)),$(-,$(getvar,osoptions),1),$(+,$(getvar,osoptions),1)) ^P with a Display Name of $(if,$(and,1,$(getvar,osoptions)),!.)OsnapHatch While OsnapHatch still works in 2019 it's hasn't been listed in help since before the 2015 versions. 1 Quote
harinezumi Posted June 26, 2019 Author Posted June 26, 2019 (edited) On 6/19/2019 at 6:43 PM, steven-g said: $(index,$(getvar, osnaphatch),"Current snap to hatch: off,Current snap to hatch: on") I only prefer to changeit to "Toggle snap to hatch ON,Toggle snap to hatch OFF" wich I find more meaningfull Edited June 26, 2019 by harinezumi Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.