An annotation symbol is a symbol applied to a family to uniquely identify that family in a project.
Figure 76: Annotation Symbol with two leaders
Annotation symbols can be created using the following overload of the Creation.Document.NewFamilyInstance() method:
Code Region 16-6: Create a new Annotation Symbol |
public FamilyInstance NewFamilyInstance Method (XYZ origin, FamilySymbol symbol, View specView) |
The annotation symbol can be deleted using the Document.Delete() method.
Add and remove leaders using the addLeader() and removeLeader() methods.
Code Region 16-7: Using addLeader() and removeLeader() |
public void AddAndRemoveLeaders(AnnotationSymbol symbol) { // check if there are any leaders currently attached, and remove them IList<Leader> leaders = symbol.GetLeaders(); if (leaders != null && leaders.Count > 0) { for (int i = leaders.Count; i > 0; i--) { symbol.removeLeader(); } } // add one new leader instead symbol.addLeader(); } |