Message 1 of 3
Creating Custom Tag Family with Dynamic Parameters via Revit API C#
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Hello Revit API experts,
I'm working on automating the creation of tag families using C# in Revit API. My specific goal is to:
- Either create a new tag family from scratch OR modify/copy an existing tag family from Revit 2022
- Add custom labels to this tag that can be linked to dynamic parameters
- Configure these labels to display parameter values from the tagged elements
My main challenges are:
- What's the correct approach to create/modify a tag family programmatically?
- How to properly add and configure label parameters within the tag family?
- How to establish the connection between the label and the parameters we want to display?
Here's what I've tried so far:
FamilyManager famMan = doc.FamilyManager;
FamilyParameter label = famMan.AddParameter(
"Label",
BuiltInParameterGroup.PG_IDENTITY_DATA,
ParameterType.Text,
false);
However, I'm unsure about:
- The correct sequence of API calls needed for tag creation
- How to properly set up the label-parameter associations
- Whether we need special handling for tag families compared to regular families
- The best practices for handling shared parameters in this context
Has anyone successfully implemented something similar? Any code examples or guidance would be greatly appreciated, particularly regarding:
- The proper API calls for tag family creation/modification
- Setting up labels and their parameter associations
- Any specific considerations for tag families vs regular families
Thank you in advance for your help!
Technical Environment:
- Revit 2022
- C# (.NET Framework)
- Revit API