Tooltips of family parameters via API

Tooltips of family parameters via API

marcelo_quevedo
Contributor Contributor
2,013 Views
4 Replies
Message 1 of 5

Tooltips of family parameters via API

marcelo_quevedo
Contributor
Contributor

Hello,

We need to query and edit the Tooltips of family parameters through the API. As I have investigated the API documentation, the Revit API does not provide access to work with Tooltip of a family parameter; However, it is really important for us to read the Tooltips of parameters from existing families to set/edit automatic Tooltips. We would be very grateful if you could help me with some directions or workaround to achieve this task?

 

Thanks so much in advance!

Marcelo Quevedo

0 Likes
2,014 Views
4 Replies
Replies (4)
Message 2 of 5

jeremytammik
Autodesk
Autodesk

Dear Marcelo,

 

Thank you for your query.

 

You can access and manipulate tooltips quite easily using the Windows API.

 

Kean Walmsley implemented a tooltip translation utility for AutoCAD and Inventor, and I adapted it for Revit as well:

 

 

I hope this helps.

 

Best regards,

 

Jeremy



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

0 Likes
Message 3 of 5

RPTHOMAS108
Mentor
Mentor

There is certain access to family parameter tooltips via the API.

 

To set a tooltip you use FamilyManager.SetDescription (strangely there is no similar .GetDescription).

 

Description (tooltip) is a property of the ExternalDefinition class but all FamilyParameters appear to have InternalDefinitions (regardless of source) in the RevitLookup. I don't know if this is an error in the Lookup tool or the reality that FamilyParameters (even shared ones with GUIDs) don't have ExternalDefinitions.

 

I mention the above because unfortunately the InternalDefinition has no Description property (is this what you mean)? 

0 Likes
Message 4 of 5

marcelo_quevedo
Contributor
Contributor

Thank you, Jeremy and Richard, for your replies.

 

I could use FamilyManager.SetDescription to set the ToolTip FamilyParameter as Richard mentioned; however, as first action, I need to read the existing ToolTips that were set by the user because I need to translate them to other language. (Image explanation is attached).

 

I could read the Tooltips that are stored in a sharedParameter file.  Only in this case, when I read the parameter from shared parameter file, I could access to ExternalDefinition.Description. Here a sample code lines about it.

 

  DefinitionFile df = this.m_app.OpenSharedParameterFile();

  ExternalDefinition  ed = df.Groups.First().Definitions.First() as ExternalDefinition;

  string toolTip = ed.Description;

 

Nevertheless, this shared parameter file approach is not completely a good solution because users create families with some shared parameters by using their share parameter files, and I don’t have access to these shared parameter files to obtain the tooltips because as you know, shared parameter files don’t travel with Revit files.

 

Also, I still need to access to Tooltips that are set in the Family Parameters (not shared).

 

If you have some extra idea, I will appreciate a lot.

Thank you so much guys.

Marcelo.

0 Likes
Message 5 of 5

tamas.deri
Advocate
Advocate

I am having the same problem, so I've created a corresponding Revit Idea, please vote!

https://forums.autodesk.com/t5/revit-ideas/revit-api-read-familyparameter-description/idi-p/10596144

0 Likes