I have beat myself silly trying to figure this out.. I wish to show Family Name, Type and Coordinates of a Family Instance. I can get The Type, but am unable to figure out how to get the Family that the Type belongs to.. Here is my code:
IEnumerator e = collection.GetEnumerator();
bool MoreValue = e.MoveNext();
while (MoreValue)
{
Element component = e.Current as Element;
LocationPoint obJCoord;
obJCoord = (LocationPoint)component.Location;
ElementId id = component.GetTypeId();
ElementType et = doc.get_Element(id) as ElementType;
TaskDialog.Show("ObjectIformation", "ElementType - " + et.Name.ToString() + "\n"+
"Coordinates - " + obJCoord.Point.ToString()) ;
MoreValue = e.MoveNext();
}
What do I need to do?
Solved! Go to Solution.
I inserted some code that should move you along to wherever you are going. Good luck!
IEnumerator e = collection.GetEnumerator();
bool MoreValue = e.MoveNext();
while (MoreValue)
{
Element component = e.Current as Element;
FamilyInstance fInstance = e as FamilyInstance;
FamilySymbol FType = fInstance.Symbol;
Family Fam = FType.Family;
LocationPoint obJCoord;
obJCoord = (LocationPoint)component.Location;
ElementId id = component.GetTypeId();
ElementType et = doc.get_Element(id) as ElementType;
TaskDialog.Show("ObjectIformation", "ElementType - " + et.Name.ToString() + "\n"+
"Coordinates - " + obJCoord.Point.ToString()) ;
MoreValue = e.MoveNext();
Can't find what you're looking for? Ask the community or share your knowledge.