Shared Parameters and Multi-Category | Auto update

Shared Parameters and Multi-Category | Auto update

jejeno2544
Participant Participant
243 Views
2 Replies
Message 1 of 3

Shared Parameters and Multi-Category | Auto update

jejeno2544
Participant
Participant

Hi all, 

I'm creating an add-in that adds annotation labels to pipes, ducts, etc. 
And I need to display the length of these elements. 
I know that I can create separate annotations for each type (pipe, duct, ...):

jejeno2544_0-1667812442826.png

jejeno2544_1-1667812457597.pngjejeno2544_2-1667812482266.png

As a result, I get a lot of files.

But I want to have one common Multi-Category tag.
I've created a custom shared parameter and set the name to CustomLength. 

jejeno2544_0-1667815889999.png
The problem is that I need to manually set this parameter, and when I resize the pipe, this value is not updated automatically. 

Is there a way to create a Multi-Category - CustomLength tag that takes the information from the Length element and automatically updates if we make any changes to that element?

 

Thanks for any ideas.

0 Likes
244 Views
2 Replies
Replies (2)
Message 2 of 3

jeremy_tammik
Alumni
Alumni

You should explore how to achieve what you need manually in the end user interface first. The API will almost never provide any functionality beyond that.

 

One little API artefact that I found is the PostableCommand enumeration member:

  

MultiCategoryTag Attaches tags to elements of multiple categories, based on a shared parameter.

  

https://www.revitapidocs.com/2023/f6ccdc1b-6ac3-9c49-d0bb-8a7d1877eab0.htm

  

It mentions a shared parameter that apparently plays some role in the multi-category tagging.

  

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

ricaun
Advisor
Advisor

IUpdater works perfectly for this case.


For example, every time an element with the types Pipe, Duct, and Conduit is created or modified a code runs to update the CustomLength parameter using the build-in Length of the element.

 

 

 

Luiz Henrique Cassettari

ricaun.com - Revit API Developer

AppLoader EasyConduit WireInConduit ConduitMaterial CircuitName ElectricalUtils

0 Likes