Path array distance (no rotation).dyn (19.8 KB)
Hello everyone , Currently I have this script in which I place families along a path(model Line)
however when I am trying to use it it does not rotate the families the way that I want . (picture on the left represent the way dynamo is working , picture on the right represents how I want it)
So my question is how Can I rotate/align these families on this path quickly using dynamo .
Should I create a separate script or I can edit this script ?
Thanks
Hey mate,
If it’s referencing a linear path, best to change the family into a line-based version instead.
Dynamo wise, you’d need to do a lot more legwork to your script to reprogram the linear based family calculation.
hey Mate , thanks for the answer . The thing is That sometimes I want it to be on a linear path and sometimes on a curve . I will have a long path and I want the families to follow the path in an aligned/rotated way .
How is that achieved via dynamo
Place them, then set their rotation to the angle of the Tangent vector from the family’s facing direction.
Setting the rotation: Dynamo Dictionary
Thanks for your reply Jacob , I didn’t get exactly what did you mean that. Can you explain further please
-
Starting with your base curve.
-
Use a Curve.PointAtParameter to get a series of points along the curve. Note this may not be the spacing method you want as parameters are not equidistant from each other, but the overall concept should hold.
-
Use a Curve.TangentAtParameter to get the tangent vector at each curve.
-
Assuming your family faces up in the family environment, use a Vector.AngleAboutAxis to find the angle from the global Y axis (Vector.YAxis)to the tangent vector. Of your family faces down, or right or left or some other angle you will need to use something other than the global Y axis.
-
Use a FamilyInstance.ByOrigin node to populate a family at each point along the curve.
-
Use a FamilyInstance.SetRotation node to rotate the families by the value found in #4.
Thanks Jacob seems this is the way