0

I have collected element types using following code in Ironpython:

typeelements =  DB.FilteredElementCollector(revit.doc)\
                    .OfClass(DB.ElementType)\
                    .ToElements()

How to know whether an element collected in typeelements is present in Revit model space?

shahabaz sha
  • 61
  • 1
  • 9

1 Answers1

0

Implement another filtered element collector filtering for all family instances of the given type. More efficiently, just retrieve all family instances in one single go. From that list, you can determine all the types being used in the model.

Jeremy Tammik
  • 7,333
  • 2
  • 12
  • 17
  • Sorry, I should have explained my problem very well. My aim is to rename element type which are present only in Revit model. As per your answer i can find which element types are present in revit model. But strangely i could not find a method to find element type name which got using `.WhereElementIsElementType()` . In short i simply want a link between element type and element either in the form of name or some id. – shahabaz sha Nov 11 '20 at 11:43
  • A simple and direct link between an element and its type is provided by the [GetTypeId method](https://www.revitapidocs.com/2020/cc66ca8e-302e-f072-edca-d847bcf14c86.htm). – Jeremy Tammik Nov 12 '20 at 07:31
  • I have already tried that. Object returned by `.WhereElementIsElementType()` is `Autodesk.Revit.DB.FamilySymbol`. But for that I am always getting type id as -1. For more clarity i have asked question again here https://stackoverflow.com/questions/64790223/how-to-get-name-of-elements-collected-with-elementiselementtype . Please help if you can. – shahabaz sha Nov 12 '20 at 09:16