Place a family along a line

Dear all,

I am trying to place a family along a line with equal distance using Dynamo.

I realized that some families are put directly on the line. However, some families are off the line (see desk.jpg and tree.jpg).

What is the reason of this? This should be related to the family set up.


Secondly, how is it possible to place the family perpendicular to the line (see perp1.jpg and perp2.jpg)?


Thanks in advance.

Did you tried anything. Should be Stright forward. Use place family by points(FamilyInstance.ByPoint) and rotate by the vector (FamilyInstance.SetRotation) the line you want. Happy to help you struck Anyware.

Hi Vijay,
I am actually using the (FamilyInstance.ByPoint).
The desk family (M_Desk:1525 x 762mm) is located above and below the line but the tree family (M_RPC - Tree - Dedicious: Japanese Cherry - 4.5 Meters) is located just on the line. What could be the reason for this? What is the difference between those two families?

Also is there a simple method to set the family (e.g. a desk) perpendicular to the line instead of (FamilyInstance.SetRotation)?



Hi, for me this one working fine. try something like this ,

Family by line.dyn (22.9 KB)

Hi @mtanyer if the path is curved i would try something here

2 Likes

Dear Sovitek and Vijay,

You are right: I have a 3D curve. So Sovitek’s method fits well. However, does “Curve.NormalAtParameter” work in 3D? I get the following warning. What to do to get the “normal” if the curve is 3-dimensional?

Curve.NormalAtParameter operation failed
Curve is not planar: Cannot get Curve normal

yeah sure if i understand…pull on plane :wink:

Curve.CoordinateSystemAtParameter might help in such cases - you can pull the Z axis at any point and get an approximation of the normal, but it might flip and rotate in odd ways.

Dear Jacob and Sovitek,

Since I am a beginner in Dynamo, unfortunately I do not get what you mean by pulling the Z axis. Can you please give more explanation on this? So far I have this:
DivideLine.dyn (29.2 KB)

The nodes from your curve should be:
Curve.CoordinateSystemAtParameter > CoordinateSystem.ZAxis

For each parameter given the Z axis will be aligned to be ‘normal’ to the curve at that location. So if the curve is shaped like a n, you’ll get a Z axis to the left at the start, vertical at the middle, and to the right at the end.

1 Like

Is this what you mean Jacob? The result is an unexpected rotation.

Not really - do you have a sample dataset to use the graph above on? Building a .rvt that might look like what you’re using is likely 3/4 of the time to help produce something,

line.dwg (519.2 KB)
PlaceType.dyn (29.8 KB)

is this in Civil 3D or Revit?

Hi Jacob,
I pulled the alignment from Civil3D and I am trying to build the scene in Revit.

Any suggestion on this? I am aiming to place the family perpendicular to the line.
Thank you.

Sorry - was tied up when I got the ‘Revit’ question back and am looking at this now. Am I going to find large coordinates in your DWG when I link it into Revit? As that will make things not accurate in terms of display 100% of the time.

EDIT: The DWG has extents which are 382 miles away from the internal origin (or six English Channel crossings, or 1.4 grand canyon lengths, or 1/20 of the earth’s diameter). Your visual accuracy will not be consistent as a result. Move to the origin and you’ll likely get better results.

Here’s an example of a functional graph for the task at hand:

Note that I disabled the geometry preview of the curve it that won’t be accurate from a display standpoint anyway.

Dear Jacob,
I am trying to implement your suggestions.
The first 5 points appears to be correct.
However, when the curvature changes the instances skew unexpectedly.
What could be the reason for this?
Is it not necessary to control the rotation at each point separately?
Best regards,

Can you share your latest graph image (use the export canvas after zooming in). I can’t troubleshoot why would the out seeing that bit.