Hi everyone,
I’m using Autodesk Dynamo to place sleepers along a 3D polyline alignment (varying X, Y, Z).
Right now, I’ve set up my graph so the sleepers are always perpendicular to the Global Y axis. This looks correct in plan view, but in section view the sleeper plane is not perpendicular to the curve’s local normal at each point.
I’m trying to satisfy two conditions at the same time:
I’m currently extracting points along the curve and placing the family with FamilyInstance.ByCoordinateSystem, but I’m not sure how to correctly construct the vectors and coordinate system to achieve this orientation.
Could anyone please guide me on the exact vector logic and Dynamo nodes needed for this?
Thank you!!!
Hello @tam.nguyen and welcome here to the forum
maybe something here could do the job
Hi @sovitek . Thanks for your help. Thank you so much.
I’ve tried to follow the approach in the reference you shared, but unfortunately it doesn’t seem to work correctly for my case.
The sleepers are still not oriented perpendicular to the curve’s local normal in section view while keeping the Global Y constraint.
Can you help me to take a look again
.
arhha its in z direction as well, then try pull the curve on plane and get the normal from there and use that for rotation our use a coordinate sysem
I followed your suggestion by pulling the curve onto a plane, extracting the normal from that plane, and then using it to build the coordinate system for the family placement.
Could you please confirm if this is the correct?
yeah not sure just mean as here maybe
It’s still in vertical, I tried but can not rorate it.
hahaha bingo now i guess i understand…are you sure that family allow that kind of rotation, can you do that manuel ? if you can then i guess we can do it with dynamo as well with some rotation in vector, family transform maybe
Curve.TangentAtParameter is the only node that I could consistently get alignment with a nurbs curve
HorizontalFrameAtParameter might work well here - not sure though.
Hi @Mike.Buttery is it in a section view ?
Plan view, families are placed at height
Could work, much neater for sure
Hi, I tried your method. It works correctly in plan view, but in section view the family is not perpendicular to the curve.
So… there is a bug here but not with the logic/method.
When testing stuff for accuracy always test the simplest cases first. try first with native geometry. By using a CAD import you add 4+ geometry conversions into the mix between the source (the original DWG) and creation of the new elements (your family instances).
[0] The DWG data
[1] The import conversaion from DWG to RVT
[2] The import instance conversion from RVT to RVT instance
[3] The view conversion from RVT instance to view projection
[3] The Dynamo conversion from RVT instance to DYN geometry
[4] The Dynamo CoordinateSystem to Revit FamilyInstances
Any one of those conversions being mathematically inconsistent but display overridden will result in errors in the output. We can confirm this is an issue for your use case as the line of the Revit geometry doesn’t follow the line of the Dynamo geometry preview (the blue line gets pretty far away from the black one and then closes the gap again).
Next up, you’re leveraging a FamilyInstance.ByCoordinateSystem node which has been known to have a few bugs in terms of family placement. Try laying out Stonehenge with those nodes and you’ll likely see what I mean. Using FamilyInstance.ByCOordianteSystem + FamilyInstance.SetRotation (use the angle of the horizontal frame’s Y axis to the global Y axis about the Z axis) is likely to resolve that further.
I have done some testing in R2025 & R2027, and created a coordinates axes generic model family (R2025)
This is expected behaviour from Revit - families only rotate on the Z axis. If you are after pitch (X axis rotation) or roll (Y axis rotation) this will have to be done through family parameters, line/curve based family, adaptive points or creating workplanes for hosting
Result using curve tangent and coordinate system rotation
Result using Horizontal Frame (no rotation) - note the X axis reversal at parameter = 1
Family for reference - what happens when you use this family? I’m thinking it could be the adaptive family opposing the rotation??
Coordinates.rfa (636 KB)
Check family settings - Always vertical?? Work Plane-Based?? Try adjusting those