How to get/set non-shared Parameter ToolTip in Revit 2015?

How to get/set non-shared Parameter ToolTip in Revit 2015?

CoderBoy
Advocate Advocate
1,908 Views
15 Replies
Message 1 of 16

How to get/set non-shared Parameter ToolTip in Revit 2015?

CoderBoy
Advocate
Advocate

The Revit 2015 GUI allows the user to set a tool tip string of up to 250 characters.  This appears to be the case both when defining shared parameters but also when defining non-shared parameters (e.g. family parameters in a family, or non-shared project parameters in a project).

 

For shared parameters, it looks like the way you access that value is via the ExternalDefinition.Description property.

 

However, for non-shared parameters the InternalDefinition object does not have a Description property.

 

Neither any property called "Description" (nor even called "Tooltip") appears to be on the Parameter object nor the FamilyParameter object.  Though per the platform changes documentation it says the FamilyManager object has a SetDescription method, but there does not appear to be a parallel GetDescription method on the FamilyManager object.

 

So the question is:  how do we access the new Tooltip value for non-shared parameters using the Revit API?

 

I poked around in the latest 2015 SDK and didn't see any example code either.

 

Thanks much.

 

 

1,909 Views
15 Replies
Replies (15)
Message 2 of 16

CoderBoy
Advocate
Advocate

Additional information learned today:  We play a LOT of games to be able to get the parameter definition for shared parameters if they are project shared parameters.  This is so we can report on their GUIDs.

 

See this thread.

 

However, it seems once we've gone through all that, the Parameter.Definition object returned will NOT cast as an ExternalDefinition.  It only seems to cast as an InternalDefinition, when in reality it was a shared parameter and so should cast as an ExternalDefinition.  As mentioned earlier, the InternalDefinition class does not seem to have a Description property on it, as the ExternalDefinition class does, which is what we need to access.

 

We've even tried poking around with reflection on the Parameter object, but had no luck.

 

So at this time, we can't seem to find a way to get the tooltip text ("description") for a project parameter even if it was sourced as a shared parameter.

 

We could really use some help with understanding all of this, as it's delaying the 2015 release for one of our products.

 

Thanks again for any assistance, even if it just points us in the right direction.

0 Likes
Message 3 of 16

gopinath.taget
Alumni
Alumni

Hello,

 

You mention you used reflection to investigate. By this I am assuming you used the RevitLookup tool? If not, can you try that? If this does not help, can you please provide a sample project with the shared parameter and tooltip used and I can try and dig further and/or ask the engineering team.

 

Thanks

Gopinath

0 Likes
Message 4 of 16

CoderBoy
Advocate
Advocate

Hi there.

 

Basically, when I said we used reflection it really means we poked around in the debugger looking at everything exposed, and couldn't find a way to access the tooltip text (I believe the debugger uses reflection).  Yes, we have used the Snoop tool and it also doesn't show us this information.

 

I have made a project (attached) which has what I think is the easiest case.

 

A shared instance project parameter called "Shared Parameter" has been defined of type Length in the Dimensions group.  It has Tooltip text "This is a Shared Parameter"

 

A non-shared instance project parameter called "NonShared Parameter" has been defined of type Length in the Dimensions group.  It has Tooltip text of "This is a non shared parameter."

 

Both of these parameters have been bound to the category "Walls" and a wall has been drawn.  The parameters, along with their tooltips, appear in the parameter list just fine.

 

At the very least, when you use the Snoop tool, you'll notice the shared parameter exposes an *Internal* Definition, when really it should be an External Definition as well.  External Definitions have a "Description" property, which contains this information.  

 

Also attached is the shared parameters file.

 

You'll notice in the Revit GUI that in the projet parameter editor that you can actually go in and change the tooltip text for the non-shared parameter.

 

So again what we're after is reading the new Tooltip text values that have been set on both of these parameters, and as can be seen in the parameters list when hovering over their parameter names.

 

Thank you very much for your assistance!

 

0 Likes
Message 5 of 16

CoderBoy
Advocate
Advocate

Hi Gopinath.

 

Is there any news on this question?  

 

Thanks.

 

0 Likes
Message 6 of 16

gopinath.taget
Alumni
Alumni

Hello,

 

I have enquired with the engineering team on this. I will get back to you as soon as I hear something. Apologies for the delay.

 

Thanks,

Gopinath

0 Likes
Message 7 of 16

CoderBoy
Advocate
Advocate

Hi Gopinath.

 

Thanks for making that enquiry.  When you get a response, please let us know the results as to how to ask for this information that's new in the 2015 version GUI.

 

Thanks!

 

 

0 Likes
Message 8 of 16

gopinath.taget
Alumni
Alumni

Hello,

 

I have logged a change request with the engineering team and emailed you separately. The engineering team mentioned that there is no API to determine the tooltip for non-shared parameters.

 

Sorry for the bad news.

 

Best Regards,

Gopinath

0 Likes
Message 9 of 16

CTCDev
Explorer
Explorer

Hi Gopinath.

 

Yes, it's unfortunate the Revit API won't give us access to the new parameter tooltip text feature as seen in the 2015 Revit GUI.

 

Your submission says "for non-shared parameters" which was the title of my original message.  However, we can't figure out how to access it for shared parameters in a project either (independent of which shared parameters file we're currently using).

 

If there's a way to access that for shared parameters as stored in the project using the API, please let us know, otherwise please update the request with the development team to allow accessing the new data values from a project for both non-shared and shared parameters.

 

For that matter, accessing this information from within a family document as well.

 

Thanks very much for your work on this one.

 

 

0 Likes
Message 10 of 16

gopinath.taget
Alumni
Alumni

Hello,

 

You mentioned in your original submission that "For shared parameters, it looks like the way you access that value is via the ExternalDefinition.Description property." So ExternalDefinition.Description does not work for you?

 

Thanks

Gopinath

0 Likes
Message 11 of 16

CoderBoy
Advocate
Advocate

That is correct.

 

This is because I can't find a way to cast a project parameter's Definition to an ExternalDefinition.  It always only casts to an InternalDefinition, even when I know for a fact it's for a shared parameter.  This is a core part of the problem.  

 

The InternalDefinition class, ostensibly for non-shared parameters, does not have a "Description" property at all, which I find odd because non-shared project parameters also have tooltip text that can be defined.

 

It seems like a significant inconsistency in the Revit API.

0 Likes
Message 12 of 16

gopinath.taget
Alumni
Alumni

Hello,

 

I have updated the change request notes to include shared parameters as well.

 

Best Regards,

Gopinath

0 Likes
Message 13 of 16

GeomGym
Advocate
Advocate

Hi, 


I'm also looking to set the tooltip for a parameter from the API.  Has this been enabled?  I can't identify anything when searching.

 

Thanks,

 

Jon

0 Likes
Message 14 of 16

JimJia
Alumni
Alumni
Dear David VanSlyke, I checked the accordingly Revit wish list CF-1896 and I am sorry to say that there is currently no API access to this functionality yet. As this issue requires exploration and possibly a modification to our software. Please make a note of this number for future reference. You are welcome to request an update on the status of this issue or to provide us with additional information at any time quoting this wish list item number. This issue is important to me. What can I do to help? This issue needs to be assessed by our engineering team, and prioritized against all of the other change requests that are outstanding. As a result any information that you can provide to influence this assessment will help. Please provide the following where possible: • Impact on your application and/or your development. • The number of users affected. • The potential revenue impact to you. • The potential revenue impact to Autodesk. • Realistic timescale over which a fix would help you. • In the case of a request for a new feature or a feature enhancement, please also provide detailed Use Cases for the workflows that this change would address. This information is extremely important. Our engineering team have limited resources, and so must focus their efforts on the highest impact Change Requests. We do understand that this will cause you delays and affect your development planning, and we appreciate your cooperation and patience.

Jim Jia
Autodesk Forge Evangelist
https://forge.autodesk.com
Developer Technical Services
Autodesk Developer Network
Email: Jim.Jia@autodesk.com
0 Likes
Message 15 of 16

aricke59
Enthusiast
Enthusiast

2019 coming out soon and still no action on this request.

 

When working with the API it makes you look bad when things that can be done by the UI are simply not possible by the API.

0 Likes
Message 16 of 16

Anonymous
Not applicable

Multilanguage support is not possible without this feature. Please, implement. The idea has been posted, but you've archived it.