Revit API Forum
Welcome to Autodesk’s Revit API Forums. Share your knowledge, ask questions, and explore popular Revit API topics.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

How do I hide text of an Autodesk.Revit.UI.RibbonItem?

2 REPLIES 2
Reply
Message 1 of 3
paul.t.macknight
814 Views, 2 Replies

How do I hide text of an Autodesk.Revit.UI.RibbonItem?

I've found posts regarding the ability of the Autodesk.Windows (adWin) ribbon objects to hide the text through the ShowText Boolean property. However, I have already built most of my application with the Revit.UI button types, and am wondering if it's possible to somehow hide the text for stacked PushButtons, as shown in the attached image of the clipboard panel. I would prefer to find a way to either convert one namespace button type into the other namespace (Revit.UI => adWin, or vice versa) to achieve this rather than completely rewriting my OnStartup function to utilize the adWin namespace button types. Is this possible? Or is there some trick for Revit.UI button types that hide text without having to set the property to ChrW(20) (which also "hides" the text in the tooltip)? Or do I need to just start converting my OnStarup function to adWin?

 

I'm looking to make a sort of matrix of stacked buttons, and to be forced to keep text visible in the ribbon would expand the width of my panel far beyond what I'm willing to allow.

2 REPLIES 2
Message 2 of 3

Dear Paul,

 

Thank you for your interesting query.

 

Afaik, you can do just about anything you like with your Revit ribbon items, since they are all built using the same underlying .NET Automation library.

 

Here is an example by The Building Coder:

 

http://thebuildingcoder.typepad.com/blog/2011/02/pimp-my-autocad-or-revit-ribbon.html

 

For further explorations on manipulating the Revit ribbon items using the .NET Automation library, please browse through The Building Coder 'Automation' category:

 

https://thebuildingcoder.typepad.com/blog/automation

 

Please not that most of those workaround are unsupported, of course, so use them at your own risk and be aware of the disclaimer:

 

https://thebuildingcoder.typepad.com/blog/about-the-author.html#4

 

I hope this helps.

 

Best regards,

 

Jeremy

 



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

Message 3 of 3

Sorry for the long break from this question.

I have the adWin variant of the ribbon button working, but I have a few questions regarding my implementation of it.

 

The first: The title of the tooltip, which is controlled by the .Text property in the Revit.UI namespace, does not appear in my implementation of the adWin.RibbonButton. This is the case regardless of the value of .ShowText, which leads me to believe there is another property that would govern this, but all the searching I've done has not given me any insight as to what it could be, both online and through the autocomplete options of the dot operator for the adWin.RibbonButton. So does this method for generating buttons even allow that title to show? Is adWin.RibbonButton the correct analog to PushButton, or do I need to use something else?

 

Next Question: I understand that adWin is not supported by Autodesk, but I'm running into an issue that causes an unrecoverable error within Revit. Using Sub ComponentManager_UIElementActivated(sender As Object, e As adWin.UIElementActivatedEventArgs), I'm attempting to confirm that a specific button was pressed by accessing the e.Item.Id after checking that e, .Item, and .Id are all not Nothing. However, it appears that attempting to access e.Item in any way to perform any action causes the previously mentioned error. I can access e.UiElement just fine, but am unable to compare against the data of the button I created. know what I could be doing wrong, and since the error causes Revit to close, I don't get any type of message or recorded data stating what error occurred either in my code or in Revit.

 

Final Question: As a sort o follow-up to the previous one, I was wondering what the 3 .Command properties do, and if they could in some way be used as an alternative to the method I'm using as described in the previous question.

 

Any help you could give me would be greatly appreciated!

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Forma Design Contest


Rail Community