call the size of elements using python

call the size of elements using python

husam_al-jawhar
Enthusiast Enthusiast
923 Views
4 Replies
Message 1 of 5

call the size of elements using python

husam_al-jawhar
Enthusiast
Enthusiast

Hello,

I'm currently working on a project in Revit and I need to call the size of slabs, columns, and beams and print theses sizes by using python 2. Could you please advise me on how to do this? I've been trying to figure it out on my own, but I haven't had any luck.

Thank you for your time and help

 

0 Likes
Accepted solutions (2)
924 Views
4 Replies
Replies (4)
Message 2 of 5

jeremy_tammik
Alumni
Alumni
Accepted solution

For a rough first estimate that works for almost all elements, you can simply call the BoundingBox property and determine its X, Y and Z length:

  

https://www.revitapidocs.com/2023/def2f9f2-b23a-bcea-43a3-e6de41b014c8.htm

  

The bounding box is axis aligned. Hence, the results will mostly be pretty accurate for axis aligned objects. For non-aligned elements, the values will be too large.

  

Jeremy Tammik Developer Advocacy and Support + The Building Coder + Autodesk Developer Network + ADN Open
Message 3 of 5

husam_al-jawhar
Enthusiast
Enthusiast
Hi Jeremy, Many thanks for your answer, it works for columns and slabs, but for the beams, it is not work, and I am using precast L shape beams in this project; any advice for that?
Cheers,
0 Likes
Message 4 of 5

jeremy_tammik
Alumni
Alumni
Accepted solution

Simply use the beam location line length for the long dimension, and the beam width and height for the cross section dimensions.

  

Jeremy Tammik Developer Advocacy and Support + The Building Coder + Autodesk Developer Network + ADN Open
Message 5 of 5

husam_al-jawhar
Enthusiast
Enthusiast
Hi Jeremy,
I wanted to say thank you for your insightful answer about the problem. Your explanation was helpful and gave me a better understanding of the topic. Your willingness to share your knowledge is greatly appreciated!
Best,
Husam
0 Likes