- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Hi all,
I am a newbie in Revit API.
I am just wondering how to set the default ID for a system text families. I used the link below for the similar scenario but this can only access loadable families:
Here's the updated code that supposed to set the system text ID.
FilteredElementCollector collector = new FilteredElementCollector(doc);
collector = collector.OfClass(typeof(TextNote));
var query = from element in collector where element.Name == "Text-3.0mm-Dot-O" select element;
List<Element> famSyms = query.ToList<Element>();
ElementId symbolId = famSyms[0].Id;
FamilyInstanceFilter filter = new FamilyInstanceFilter(doc, symbolId);
collector = new FilteredElementCollector(doc);
ICollection<Element> familyInstances = collector.WherePasses(filter).ToElements();
ElementId txId = new ElementId(BuiltInCategory.OST_TextNotes);
doc.SetDefaultFamilyTypeId(txId, symbolId);
Any thoughts please.
Much appreciated,
Wil
Solved! Go to Solution.
