Noobie Python question: How do know what attributes an object has

Hi,

I’m setting up a graph in dynamo and am attempting to use Python to access from element information.

I found that I can if I select an object as long as I do UnwrapElement() I can access various information about it.

I tried this out on a wall and could access element.Width and element.Location

But what other attributes does an object have, is there a list somewhere that I can refer to?

I assume the objects attributes were the same as its type parameters - but this is not the case as element.Function does not work.

I’d appreciate some advice.

revit api manual

 

I imagine you could get more detailed information using the Python/API- but as a starting point, I suggest using Dynamo nodes, as below

The element attributes (parameters) depend on the type of element.

If you post an example of your Python & describe what you want to achieve, you might get a more detailed response

Andrew

 

in Python you can do dir(someObject) and that will list all of the methods that are available on that object type. Now, of course nothing beats Revit SDK, but dir is a quick and dirty shortcut. Have a look at this for more info: LINK

1 Like