How to get the right direction of columns from AutoCAD file

Hello guys, I want to insert columns over the following polycurves:


I can get the right dimensions of the polycurve, but the problem is getting the right direction to insert the columns. As you can see below, some columns are inserted in the wrong direction. I’ve tried many things to get the right direction but I couldn’t solve it. Does anybody have any idea how I could get the right direction?


Here is my graph and the AutoCAD file:
3 - BuildingColumns-CAD.dyn (107.8 KB)
Columns.dwg (75.6 KB)

P.S: to run the graph you have to import the AutoCAD files that contain the location of the columns and also you need to edit or create on Revit columns with the following type:

“Pilar 20x60cm” and “Pilar 30x30cm”

Hi @EdsonMatt,
you need to know if your angle should be positive or negative.
Here is a solution with dot product vectors with X axis

3 - BuildingColumns-CAD by CP.dyn (44.7 KB)

try to simplify yours scripts :wink:


Hi @c.poupin ,
Wow! Thank you so much man!!!

I’ve found a solution by my own but my script is way bigger than yours, because I’m a beginner and I didn’t know these nodes and to code with code block as you did.
Besides providing me a neat and simple script you gave me a lot to study :slight_smile: . Again, thank you.

Here is an image of your code getting the right columns direction:

1 Like