How to solve the exception: The input type is not a subclass of Element

How to solve the exception: The input type is not a subclass of Element

gnab
Enthusiast Enthusiast
340 Views
2 Replies
Message 1 of 3

How to solve the exception: The input type is not a subclass of Element

gnab
Enthusiast
Enthusiast

Hello, I'm trying to get all unused connectors in document but I'm getting the exception:

 

gnab_1-1661854394299.png

 

How to solve it?

 

0 Likes
Accepted solutions (1)
341 Views
2 Replies
Replies (2)
Message 2 of 3

sahin.ikbal
Advocate
Advocate
Accepted solution

It's Named "FilterElementCollector" it can only access the Revit Objects which are inherited from "Element" class or "Element" itself, Connector is not a Element so giving this inside the Class Filter obviously will through an error.

You need to enumerate through the elements and extract their connectors to get them all. 

 

sahinikbal_0-1661859249592.png

 

Message 3 of 3

gnab
Enthusiast
Enthusiast

Thanks for answer, I have already understood. I filtered FamilyInstance elements and then got all unused connectors.