Export Project Browser Family Tree

Export Project Browser Family Tree

Anonymous
Not applicable
1,631 Views
1 Reply
Message 1 of 2

Export Project Browser Family Tree

Anonymous
Not applicable

  How can i export Project Browser Family Tree

  eg:

    QQ截图20150327130417.jpg

 

   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 🙂 🙂

0 Likes
Accepted solutions (1)
1,632 Views
1 Reply
Reply (1)
Message 2 of 2

Aaron.Lu
Autodesk
Autodesk
Accepted solution
Dear, For system type, there is indeed no symbol family, but only have symbol name


Aaron Lu
Developer Technical Services
Autodesk Developer Network
0 Likes