Aftertouch Posted December 16, 2016 Share Posted December 16, 2016 Hello all, Im having some issues with mijn custom ribbon... i found this code below: $(if,$(=,$(getvar,cvport),1),!PORT,PORT) This allows makes the button highlighted if the variable CVPORT is 1, and else its a regular button... Now i have a lisp that makes a custom variable: (setq onoffswitch 1) I want the button to toggle the button based on this variable. In autocad i can use !onoffswitch and it returns either 0 or 1 (depending on the state). Now i try to set the code in the ribbon button to: $(if,$(=,$(onoffswitch),1),!PORT,PORT) and... $(if,$(=,$(!onoffswitch),1),!PORT,PORT) and... $(if,$(=,$($!onoffswitch),1),!PORT,PORT) Now the button shows: $(IF,??) How can this be fixed? Quote Link to comment Share on other sites More sharing options...
tombu Posted December 28, 2016 Share Posted December 28, 2016 Enter cvport at the command line and try changing the value. It's not possible. What is it you're trying to do? Quote Link to comment Share on other sites More sharing options...
Aftertouch Posted December 29, 2016 Author Share Posted December 29, 2016 What i am trying to do is the following: On startup, a lisp is loaded wich uses a few variables... (setq aanuitswitchB 0) (setq aanuitswitchV 0) (setq aanuitswitchT 0) (setq aanuitswitchN 0) (setq aanuitswitchR 0) (setq aanuitswitchX 0) there values can change with commands. i did NOT make then local, so the set value can be shown when i use !aanuitswitchB for example. this will return 0 or 1. I want a ribbon button the be highlighted when 'aanuitswitchB' is 1, and regulat when it is 0. I can only get the highlight option to work with regular AutoCAD variables.. Quote Link to comment Share on other sites More sharing options...
tombu Posted December 29, 2016 Share Posted December 29, 2016 Diesel only works with system variables. As unit values are saved in system variables there may be a solution though making it part of modemacro may work better than a ribbon button. The ribbon doesn't always reflect correct system variable settings as it doesn't regen every time a command or code is executed the way the "Object Snap Cursor Menu" does. What's the purpose of all those aanuitswitch* variables? Posting code may help get you a solution. Quote Link to comment Share on other sites More sharing options...
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.