Get Ribbon Button state (pressed or not)

Get Ribbon Button state (pressed or not)

Maxim-CADman77
Advisor Advisor
149 Views
1 Reply
Message 1 of 2

Get Ribbon Button state (pressed or not)

Maxim-CADman77
Advisor
Advisor

I'd like to know if there a way to get (read) a state of Ribbon Button (pressed or not) for example sate of "Activate Contact Solver" (Assembly - Inspect - Interference).

BTW, is there any smarter way to toggle its state except using Command Manager like

ThisApplication.CommandManager.ControlDefinitions("AssemblyContactSolverCmd").Execute

 ?

Please vote for Inventor-Idea Text Search within Option Names

0 Likes
Accepted solutions (1)
150 Views
1 Reply
Reply (1)
Message 2 of 2

WCrihfield
Mentor
Mentor
Accepted solution

Hi @Maxim-CADman77.  The one thing that comes to mind are the settings on the 'Modeling' tab of the 'Document Settings' of the assembly, within the 'Interactive Contact' area.  Those can be reached through AssemblyDocument.ModelingSettings property, then the two API properties are at ModelingSettings.InteractiveContactAnalysis (uses a variation of the InteractiveContactAnalysisEnum) and ModelingSettings.InteractiveContactSurfaces (uses a variation of the InteractiveContactSurfacesEnum).  When we first open a regular assembly that has not been using this resource, and look at its 'analysis' property, it will be set to the 'kSolverOffInteractiveContact' variation.  Then when we click on the 'Activate Contact Solver' button in the ribbon, its value changes to the 'kContactSetOnlyInteractiveContact' variation...at least for me.  Maybe that could be used as the indicator for if this mode is active or not.

Wesley Crihfield

EESignature

(Not an Autodesk Employee)