Hi,
I want to be able to use Python to select all objects in the Revit document based on the what the user has selected in a ‘Select Model Element’ node.
So, the user would use the ‘Select Model Element’ node to select a wall and then when the Python code is run all walls would be selected in the UI.
The problem I have is how to construct a FilteredElementCollector based on the object selected.
Looking at the FilteredElementCollector class, there is a method called ‘OfClass’ which (I believe) selects all elements of a particular class.
I think this could work if I could work out the class of the element selected by the user in the ‘Select Model Element’ node.
I’ve used the dir() function to see what can be done with the selected element, and I can see that there is the ability to return the class with:
selectedobject.class
But this returns ‘IronPython.Runtime.Types.PythonType’ which is of no use to me.
Is there an easy way to determine an objects class to that I can use the FilteredElementCollector OfClass method to select objects.
Thanks