Disable DockablePane for IExternalCommand Execute

Disable DockablePane for IExternalCommand Execute

marius.fe
Contributor Contributor
360 Views
2 Replies
Message 1 of 3

Disable DockablePane for IExternalCommand Execute

marius.fe
Contributor
Contributor

Dear all,

 

I have been searching for a while, but did not find an elegant solution yet. Using Revit 2020 at the moment.

I have a DockablePane in my application. It is similar to what is done in the DockableDialogs Revit SDK sample.

 

If a command that derives from IExternalCommand is executed, all the buttons in the UI and also the Project Browser is disabled, see picture. The custom DockablePane is still enabled and every button/element can be used. I want the whole pane to be disabled.

mariusfe_0-1668590058422.png

 

I know I could use the IsEnabled binding of the view. But I want to use the Revit UI state if possible.

 

Does anyone know if and how this is possible?

 

Thanks in advance!

0 Likes
361 Views
2 Replies
Replies (2)
Message 2 of 3

RPTHOMAS108
Mentor
Mentor

It think it is essentially the opposite of the idling event which can be therefore developed from that.

 

Possibly also ActiveAddInId accessible from various Application objects in conjunction with idling event.

 

Alternatively, I believe some use AdWindows to check the Revit UI state so you may find examples of that.

 

Lastly if you have added ribbon buttons you can check RibbonButton.IsEnabledByContext, this would require checking at a timed interval.

0 Likes
Message 3 of 3

marius.fe
Contributor
Contributor

Thank you for the answer! We did it via direct calls because of a missing event that is triggered during external command calls. Not elegant now, but it works good.

0 Likes