Array Families Along a Straight Line

Hello! I’ve read a lot about similiar topics on how to array an object along a curve (which I guess is much more difficult than a straight line). I found it very difficult to work with geometry in Dynamo so after hours of trying, I hope someone here can help me with this.

I would like to draw a straight line in Revit, choose a family, and array it along the line and be able to control the distance the two families.

What I dont want though is to have the line there as a visible element. The line is only there for guidance so that I can choose where I want to array the families.

I would be forever grateful if someone could help me with this

Hello!

What aspect of the script are you having difficulty with/what have you tried thus far?

From your description, the core concepts seem to be:

  • Draw/Select a line to initiate the run.
  • Define the array count + spacing
    -For simplicity’s sake, is the first array point the StartPoint of the line?
  • Place families
  • Cleanup: Remove the drawn line

If you want the line to be removed within Dynamo and not manually yourself, you will probably need a passthrough node so that the process is ordered.

Thank you so much for your help.
I’m having difficulties trying to understand how the geometric nodes work.
I dont know how to define the array count + spacing along the selected line and how to place the families.

Hi Denish, you need to make a range with a simple code block: (or use this node: Dynamo Dictionary)

0..Curve.Length(curve)..spacing;

then input this into you point at segmentlength node :slight_smile:

I dont really understand how you mean :frowning:

Spacing refers to the array spacing, try changing the value to a positive number.

It created some dots with the correct spacing but there are no families.


So the error code is telling us that the family is level-based. If that is the case you have to use a slightly different family node:

image

1 Like

Even though it works it still gives some kind of error in the script



I would like the first family to start from the side and not from the center like this:

Better picture of how I would like it to array along the line


Because if I draw a line from a wall, I don’t want it to be inside the wall like it is now.

What you’re describing now is a Translate (moving the array of points a fixed distance away).

You would take the list of points from your Curve node and pass them through a Geometry.Translate node to get the new positions. I’ll leave it as an exercise to you to try this out, there are a few Translate methods so you should find one that makes the most sense to your workflow.

That makes a lot of sense. But I’m still very confused. I don’t know which way I should solve it.
Isn’t it possible to start the first family from the beginning of the line and then array it from the center?


Because if I want to move the array of points a fixed distance away, that distance depends on the geometry of the family. That sounds extremely complicated.
I’m confused.

Btw, do you know why there is some kind of untouchable line there after you run the script and even delete the old line manually afterwards? There is like a blue line there that you can’t delete.

When you create a range, you can get FamilyInstance parameter data to feed the start point.
For the blue line, you can right-click and turn off preview.

Hi there @Denish97,

In the code block which i specified the range starts with 0, however you can change this value out for another value or even an input, like this:

StartDistance..Curve.Length(curve)..Spacing;

Then you can create the same sort of input for the start distace as the spacing.

Also if you want do determine how far you exactly you need to go, you could get the geometry of the family > faces and check what the intersection point is with the line, then use that distance as the startdistance input.

To determine what this start distance needs to be you should:

  1. Get the geometry of the family
  2. Get the faces of this family
  3. Get the startpoint of the line and the tangent, reverse it and create a small line in the opposite direction
  4. Determine the intersection point between the face on the left and the line.
  5. Determine the distance from the startpoint of the line and this intersection point.
  6. Use this distance as the startdistance input.