Jump to content

DIESEL function within ribbon button, highlight buttons


Aftertouch

Recommended Posts

Hello all,

I have build my own ribbon, but i experience a problem.

I have a button in my ribbon that shows the text:

STATUS: $(substr,$(getvar,USERS1),1,1)

 

When i start a drawing, the ribbon updates to the text as it should.

BUT...

When i change the value of USERS1, it does not change in the ribbon.... how can i solve this???

 

I want that text to by dynamic to the USERS1.

 

 

also...

Is it possible to let a buton look 'pressed' depending on a variable?

Like... when filedia = 1 i want a button to look 'pressed/highlighted' and when its 0 it looks regular.

Link to comment
Share on other sites

Does not work.

The only thing that works is when i do WSCURRENT. then it 'reload' everything with the right settings.

But due to our drawingsystem, this variable can change a few times per minute, so i want it to by dynamic. :-)

Link to comment
Share on other sites

In my experience with DIESEL and Macros, there is a delay from setting a variable to it being available for use. For example if you set a variable in a macro and attempt to use it in that same macro, it will not use the new value, but the old value.

 

I'd expect that the issue you are experiencing is the same.

 

Great work with the DIESEL though, that is a great idea of pushing the boundaries! I hope you can get something to work.

Link to comment
Share on other sites

Besides Modemacro which I've used for many years I added a flyout to the "Object Snap Cursor Menu" Shortcut Menu named

$(eval,OSNAP = $(if,$(and,16384,$(getvar,osmode)),"Off","On"))

that has a lot of macros that toggle system variables that update their display automatically. I was never able to do the same in the Ribbon.

 

This one displays whether or not you can snap to Hatch objects:

Display Name:

$(if,$(and,1,$(getvar,osnaphatch)),!.)Hatch

Command Name: Hatch

Description: Snap to Hatch Objects

Macro:

^P'setvar;osoptions;$M=$(if,$(and,1,$(getvar,osoptions)),$(-,$(getvar,osoptions),1),$(+,$(getvar,osoptions),1)) ^P 

 

HTH

Link to comment
Share on other sites

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.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...