I’m trying to array an object along a model line and rotate it with the tangent to the line. It works ok with lines/arcs that run along x but the closer the line turns towards the y axis things start to break for some reason and I can’t figure out why. Any advice helpful. Thanks in advance.
That is hard in Revit, you ask him to rotatie by a vector, so when you have an other position in Revit your script does not what he has to do, I had the same with foundation brackets. You can’t work with x and y because you don’t know the position of the building for example.
What I did in my script is sorting the brackets by a spline and after that you can do your thing
Thank you @jw.vanasselt After some trial and error I was able to determine that it has to do with the direction in which the model line is drawn and this node here:
This is so frustrating. All I want to do is array along a path in Revit. All these curves were drawn in the same direction but the vector transformation is not equal:
I think the issue is somewhere with the vector.anglewithvector. It’s not returning the correct angle. I’m not sure if it has to do with angles bigger than 90
oh my god yes! @EdsonMatt Could you pin point what was the issue? Was there a limit on the angle with vectorAngle? Also, is that Python in the codeblock? I can reverse engineer it if you tell me the language and you don’t want to walk me through it. Greatly appreciated!
I don’t have a compelling explanation for that yet. I just measured the dot product between your vectors and vector y and realize that those whose values were > 0 were the ones with the wrong direction. If nobody has an explanation for that and also if there isn’t an explanation in the forum about it (probably it does), I’ll search about it when I have time .
It’s DesignScript, it’s basically the same thing when you use nodes, it’s just a written way (you can test yourself by right-clicking a node and choosing the option “node to code” or search “node to code” using the search tool here on the forum, you’ll find lots of information ).