
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
How can i export Project Browser Family Tree
eg:
through this Code:
public Result Execute(ExternalCommandData commandData, ref string message, ElementSet elements)
{
// Get the application and document
Document activeDoc = commandData.Application.ActiveUIDocument.Document;
var familyTypeCollector1 = new FilteredElementCollector(activeDoc);
familyTypeCollector1.OfClass(typeof(ElementType));
IList<Element> famTypes = familyTypeCollector1.ToElements();
//Save File Path
System.IO.StreamWriter writer = new System.IO.StreamWriter("f:\\ElementTypes.txt");
foreach (Element ele in famTypes)
{
ElementType type = ele as ElementType;
if (null != type.Category)
{
//Get the Fmaily's CategoryName and id
writer.Write(type.Category.Name +"/"+type.Category.Id+":");
//Get the Fmaily's symbolName and id( id is null or 0)
writer.Write(type.get_Parameter(BuiltInParameter.SYMBOL_FAMILY_NAME_PARAM).AsString() + "/");
Parameter para = type.get_Parameter(BuiltInParameter.SYMBOL_ID_PARAM);
writer.Write(para.AsInteger() + ":");
//Get the Family's TypeName and id
writer.Write(type.Name + "/" + type.Id);
writer.WriteLine("");
}
}
return Result.Succeeded;
}
In this code ,i can't get the Symbol family id , help 🙂 🙂
Solved! Go to Solution.