Controlling opening locations

Hi,

I have a question about dynamo in Revit.
First of all, I want to mention that I am completely new in Dynamo and have just started learning it.
So my first issue is:

I am trying to perform the automatic bringing the holes to the position of the middle point of panel

I made a dynamoscript to one point and i don’t know how to proceed.
Maybe I’m doing it completely wrong and I have the wrong work logic…

The main problem is that the positions of the panels and holes are not displayed in the correct coordinate system in the project. dynamo cannot recognize this. The holes are void extrusions inside the family and they have their positions relative to the panel.

If anyone can help me or give me a hint, I would be grateful

Kr, Goran

If the origin of the equipment family is relative to the origin of the opening family, and both are hosted on the same wall, this method might work:

You would need to install the custom package “Spring” in order to use the “Element.SetLocation” node

1 Like

Unfortunately, it will not work because the opening is inside the family and has its own dimensional family parameters in the family(curtain wall), as i mention in the last post .

The biggest problem for me is how to connect coordinate system between those families, curtain wall and air terminal? My idea is that the opening follows air terminal.

Instead of building a point from the panel’s parameter values, you want to find the location of where the opening would place if given the 0,0 value - ideally this is one corner of the panel, as then you could use a series of Topology.Verticies, List.GetItemAtIndex, and Vertext.PointGeometry nodes.

Can you please be more specific? Can you give me a simple and short example
Tnx

Not really, as the amount of time to rebuild your family and create an instance in a way like you have built in a project is pretty significant and requires making a lot of assumptions, one or more of which will ultimately be wrong. I can give a list of steps I would follow as a first attempt.

  1. From your selection, use a Topology.Verticies node to get all the vertices of the shape.

  2. Then use a Vertex.PointGeometry to get the points as something you can see.

  3. Use a List.GetItemAtIndex node to pull the point which aligns to where the opening would be if you gave it values of 0,0. It will help to disable the geometry preview on other nodes.

  4. Build a vector from this point to the penetration’s point.

  5. Pull the Z value from that vector - this is the first offset distance.

  6. Use some trigonometry to find the other offset.

  7. Set the panel’s parameter values accordingly.

For first attempt, i know what i need to do.
Tnx a lot

1 Like

Hello,
The first three steps i solve it, but the others
unfortunately, i just cant. I found the points on corners of the panels but i dont know how to use vectors in dynamo in this case. How to connect air terminal and this holes and that corner and make them move as i want


O, I found the center points of the holes


The last thing I need to do is move those holes with my air terminals. What is the best way to do this?

Do I need some additional dimensional parameters?

Ok you have the center point of the hole, do you have the center point of the duct?

Build a vector from the opening point to the penetration point using a Vector.ByTwoPoints node.

Take the vector’s X, Y and Z components using a Vector.X, Vector.Y, and Vector.Z node.

The required nodes for the trigonomic functions will be under the Math section of the library. :slight_smile:

1 Like

Ok,
I finnaly got the positions.
In the end I used the line node so you can see where i need to move with holes. Now, my question is, how do I move those holes to the this positions?
Holes are actually voids inside the family. Can you please give mi some hint


Tnx

Looking good.

Keep the line for now, but use a Vector instead. This will get you a meaningful offset faster. Vector.ByTwoPoints I believe is what you are after. :slight_smile:

After that, pull the X and Y component from the vector with a Vector.X And a Vector.Y node. Those values need to be added to the current opening offset - so grab the opening location parameter X and Y values from before, and add the result of the Vector.X and Vector.Y nodes. These are the new values to use in an Element.SetParameterValueByName node, which is the last step in the process.

You’re almost there - keep it up!

1 Like

I almost done, but I still have a little problem :slight_smile:

When I set the default position of the hole (0.0), the orientation position of the coordinate is on the left corner of the panel,

however when I run the script, the same point returns to the right position.


The problem is that I can’t get the correct positions on the x axis. Everything turns out well when the air terminal is in the middle of the panel.
What am I doing wrong? :slight_smile:

Can you post your graph and a sample Revit file with two panels - one which works and one which fails? Narrowing the issue requires a bit more insight than the images are providing. If you can’t post here yet any online host will work (google drive, onedrive, box, Dropbox, etc.).

https://drive.google.com/drive/folders/1q1Ok33LtKtLtsKlAbJHeTYEURh8Awfzo?usp=sharinghttps://drive.google.com/drive/folders/1q1Ok33LtKtLtsKlAbJHeTYEURh8Awfzo?usp=sharing

I sent to you a project file with two panels and dynamo script. So when you run the script, The panel holes do not move in the x-axis direction properly.

I’m sending you a link to google drive with exemple on rvt file and dynamo graph. I think it should be fine now.
https://drive.google.com/drive/folders/1q1Ok33LtKtLtsKlAbJHeTYEURh8Awfzo?usp=sharing
Tnx for help :slight_smile:

1 Like

Just to mention once again, I would say I am very close to a solution but I can’t get an alignment in the x axis. So you Can take a look at the files to see what can be done.

By the way, I’m interested in one more thing. Is there a way that the air terminal can recognize the panel as spaces because I have to insert them in a certain order to make the lists match. Just a hint and which nodes if is possible.

1 Like

Hello again,
I am pretty desperate with this problem. I can’t make my points fixed. i want the starting point for moving the holes to be in the lower right corner of the panel. However when I click run, my points move to the left corner, as you can see on picture


But when I second time click run, I get the correct positions of my points where i want them to be from the beginning

The final result is that dynamo calculates the movement of the holes from the wrong position and I actually get the mirror position from the right position along the x axis

Capture 3

Can anyone help me, how to solve the problem? :slight_smile: