Show/Hide Ribbon Buttons depending on Project or Family Editor

Show/Hide Ribbon Buttons depending on Project or Family Editor

RickyBell
Enthusiast Enthusiast
865 Views
3 Replies
Message 1 of 4

Show/Hide Ribbon Buttons depending on Project or Family Editor

RickyBell
Enthusiast
Enthusiast

I'm using this code to create a ribbon panel and place some buttons on it.

 

RibbonPanel ribbonPanel = application.CreateRibbonPanel(firstPanelName);

PushButtonData buttonData = new PushButtonData(... etc..

 

Is there a way to change the visibility of button based on if you're in a project view or the family editor?  I have different tools specific to both views and I'd like to prevent the user from running a family tool on a project.

 

Any help is appreciated, Thanks!

0 Likes
866 Views
3 Replies
Replies (3)
Message 2 of 4

jeremytammik
Autodesk
Autodesk
0 Likes
Message 3 of 4

RickyBell
Enthusiast
Enthusiast

Thanks!  That definitely pointed me in the right direction.  It seems that all the samples I'm finding are triggered by what you have selected or by what version of Revit you're using.  They work just fine.  Is there a way to have it look for Project vs. Family Editor for the trigger?

0 Likes
Message 4 of 4

jeremytammik
Autodesk
Autodesk

You ciould try the Document.OwnerFamily property:

 

http://revitapisearch.com/html/95b303dc-1569-492d-6863-fbe49f6189b0.htm

 

Cheers,

 

Jeremy



Jeremy Tammik
Developer Technical Services
Autodesk Developer Network, ADN Open
The Building Coder

0 Likes