Setting the 'Label' parameter of TextElements via API

Setting the 'Label' parameter of TextElements via API

Anonymous
Not applicable
7,767 Views
22 Replies
Message 1 of 23

Setting the 'Label' parameter of TextElements via API

Anonymous
Not applicable

I'm trying to set the Label Parameter of TextElements via API in the same way like users do via GUI. Is there a way to set the parameter relationship to an elements parameter that receive the value and the TextElement that show the value in plans?

0 Likes
7,768 Views
22 Replies
Replies (22)
Message 21 of 23

jeremy_tammik
Alumni
Alumni

You could submit a wish for this functionality to the Revit Idea Station.

 

Whenever you require a new or enhanced Revit product or Revit API functionality, the Revit Idea Station is the place to go.

 

Please search there for a corresponding wish list entry for the suggested functionality and add your comments to it, or create a new one, if none already exists:

 

https://forums.autodesk.com/t5/revit-ideas/idb-p/302

 

Tag it as an API wish:

 

https://forums.autodesk.com/t5/revit-ideas/idb-p/302/tab/most-recent/label-name/api

 

Ensuring that a wish gets as many votes as possible helps underline its importance to you and the rest of the developer community.

 

The Revit Idea Station is currently one of the main driving input forces for Revit API enhancements.

 

The Revit development team looks there. Your comment here in the discussion forum might be overlooked.

 

Thank you!

 

Jeremy Tammik Developer Advocacy and Support + The Building Coder + Autodesk Developer Network + ADN Open
0 Likes
Message 22 of 23

brownbr2VHQE
Contributor
Contributor

I have went and voted for this idea, but wanted to add to this thread my adhoc solution.

One work around I did on reading which parameters were being used.
On the topic of parameter maintenance, I wanted to gather information about which parameters were being actively used in tags.

So I used tag.TagText and then compared that value to the values of the parameters returned from taggedElement.Parameters to deduce which parameters were driving the TagText. Obviously this becomes exponentially more complicated with concatenated parameters and delimiters, but it served my purpose. 

0 Likes
Message 23 of 23

lionel.kai
Advisor
Advisor

I really love Jeremy's first response:

 


@jeremytammik wrote:

I would expect it to be possible to achieve the same result programmatically as you do through the user interface.

cuz I would expect that, too! Unfortunately, that's nowhere near reality.

 

And eleven years later... still nothing.

 

FYI, there's another overlapping/duplicate idea here:

 

List parameters used in a Label (TextElement) within a family document - Autodesk Community

 

and there are various clunky workarounds, but there's really only so much we can do until Autodesk decides to finish exposing the full Revit API...


Lionel J. Camara
BIM Manager at KAI Hawaii, Inc. - Structural and Forensic Engineers
Autodesk Certified Professional
0 Likes