Optimize code

Good with everyone.
All this time I have been developing a script but it takes a long time to run and I wanted to know if you could help me optimize it either through a python script or any other means that allows me to evaluate the elements faster without losing the information returned by the script.

  • The purpose of this script is to return the axes of the columns, the upper surfaces of the column covers, the lower surfaces of the column covers, the lateral surfaces of the columns, the vectors of the columna axes.
    Optimizer_v1.rvt (4.6 MB)
    Optimizer_v.1.dyn (147.9 KB)

Just a quick glance. But you are calculating the axes and the vectors? You can pull that info directly out of the column with the LocationCurve and its associated information. Pretty much everything should be ready and at hand from what you’ve described. Again, maybe there is more to it than what I see at first glance.

But with the API, this is all pretty quick. Pull the LocationCurve, pull the geometry. Use the Normals on the geometry to determine, top, bottom and sides. Vectors and endpoint are already on the location curve. And done.

1 Like