Hi all,
I have a few custom ribbon buttons i've added but need them to "see" changes in the results of Named Expressions to do things like change buttons from displaying "Enabled" to "Disabled", etc. eg. I click a button to load AutoTurn and the button changes to "Unload Autoturn" or i want to toggle a setting and want it to tell me the state of that setting. I can get all this info in Named Expressions, but can't get a "Sync Item Event" to be triggered on demand outside of the Model, Selection Set, View or Primitive tool changed options that are there in the Customize Ribbon Dialog.
For toolbars i can do this easily by adding the command "TASK RELOAD" to the button command, but the only equivalent i can find for ribbons is "RIBBON REBUILD".
The problem with this is that a ribbon rebuild naturally takes 2 seconds to complete, but i was looking for something lighter that just triggers a reload of ribbon visibility/enable expressions.
Any ideas?
Regards,
Mark
OpenRoads Designer 2021 R2 (10.10) | Microstation CE Update 16.2 | ProjectWise CE 3.4
Hi Mark,
I guess you use standard "user level" ribbon customization through Customize ribbon dialog?
Mark Shamoun said: like change buttons from displaying "Enabled" to "Disabled"
In ribbon definition, enable/disable state of ribbon controls is defined by so called Feature aspect settings.
Mark Shamoun said:eg. I click a button to load AutoTurn and the button changes to "Unload Autoturn"
I guess there is (maybe) some way how to change button caption (text) using API, but more straightforward way is to swap buttons (using Show Expression configuration), first to hide and second to show ;-)
Mark Shamoun said:or i want to toggle a setting and want it to tell me the state of that setting.
What ribbon control do you use? There is Toggle button available in ribbon definition, but I think it is not available in GUI customization and (unfortunately) I did not use it yet, so I have no experience how it works.
Mark Shamoun said:but can't get a "Sync Item Event" to be triggered on demand outside of the Model, Selection Set, View or Primitive tool changed options that are there in the Customize Ribbon Dialog.
There are pre-defined set of sync events that can be received by ribbon controls. There are much more available (I think about 140), when ribbon is defined through xml/rsc definition, but often what is needed, is missing ;-)
When application is well-written for CE, it may raise of sync item, and it is also possible to implement own one.
Mark Shamoun said:Any ideas?
There is no simple solution available in my opinion. When you want to implement complex customization, you must use xml definition (using SDK documentation and plenty of testing) with properly defined FeatureAspect and ShowExpression. Unfortunately, when it's not clear what and if particular sync item can be used, it requires lengthy testing or to implement own one.
Jan
Bentley Accredited Developer: iTwin Platform - AssociateLabyrinth Technology | dev.notes() | cad.point