Adding Leaders to Tags

Adding Leaders to Tags

bndlyosi
Explorer Explorer
558 Views
3 Replies
Message 1 of 4

Adding Leaders to Tags

bndlyosi
Explorer
Explorer

I'm trying to add a Leader to a tag via revit api
and I am not succeeding
The question is whether there is such a possibility
Or alternatively change the tag to a different tag as it is possible to add a Leader
Thank you Yossi

0 Likes
559 Views
3 Replies
Replies (3)
Message 2 of 4

ricaun
Advisor
Advisor

Yes is possible,

 

Inside the IndependentTag Class you have the HasLeader.

 

Set to true should enable the Leader.

 

IndependentTag independentTag = ...
independentTag.HasLeader = true;

 

See yaa!

 

Luiz Henrique Cassettari

ricaun.com - Revit API Developer

AppLoader EasyConduit WireInConduit ConduitMaterial CircuitName ElectricalUtils

0 Likes
Message 3 of 4

bndlyosi
Explorer
Explorer
thank you for the answer
But HasLeader defines whether there will be a tag or not
I'm looking to add a tag
0 Likes
Message 4 of 4

vadim.parnitski
Advocate
Advocate

Good time of day. Add and remove leaders using the addLeader() and removeLeader() methods.

public void AddAndRemoveLeaders(AnnotationSymbol symbol)
        {
            // check if there are any leaders currently attached, and remove them
            IList<Leader> leaders = symbol.GetLeaders();

            if (leaders != null)
            {
                for (int i = leaders.Count; i > 0; i--)
                {
                    symbol.removeLeader();
                }
            }

            // add one new leader instead
            symbol.addLeader();
        }

Vadym Parnytskyi | Вадим Парницький

BIM Expert & Autodesk Instructor & CEO BIMHELP

EESignature

FacebookFacebook | LinkedInLinkedIn | YouTubeYouTube