Ever wanted to create lots of crossing beams on two walls? Have you done this manually for years? Well, what would you say if I told you we could do this in just 5 minuets with only 17 nodes in Dynamo?
So, First off, lets look at getting the edged of the walls and creating a list so that we can add points onto the wall. To select the edges of both walls within Revit we can use the “Select Edge” node. Click select and select the edges of the walls within Revit. Next we want to create a list showing the coordinates of the walls. Use the “List.Create” node and use the + to add an item. wire them together and we now have a list showing the X,Y & Z start and endpoints of the selected walls.Now we know the start and end points of the selected edges of the walls we now need to place points along the wall so that we can attach our geometry. To do this we are going to use the “Curve.PointAtParameter” node. This node takes the list and converts it into points but to place multiple points this requires a function to be programmed into the param input port. To create this we are going to create our own custom node, using a “Code Block”. For those of you that are new to Dynamo, to add a code block simply double-click on a free space. Within the Code Block we first need to specify the start and end point of the edges. Dynamo understands that “0” is the start of an element and “1” is the end, so we fist need to tell it that we are using the full length of the line. to do this we program the code block with 0..1 and then we want to specify the amount of points we require. To do this we add ..#10 this tells the parameter that we are dividing it by 10.
Your code clock should have the text – 0..1..#10 Wire everything together and you have;
One point at the end of one wall and a point offset from the end of the other wall. This is the important bit 🙂 To get the correct amount of points on the edges of the walls we need to change the lacing of the “Curve.PointAtParameter” node to Cross Product. Easy??… Right click on the Curve.PointAtParameter node click on lacing and change it to cross product. We now have 10 points on each wall.
So the next thing that we need to do is to take the first item of the list and last item from the list. We can do this by using the “List.FirstItem” and the “List.LastItem” nodes. with the point output from the Curve.PointAtParamter note into the input ports of the first and last item nodes. Now that we have the first and last items of the list we need to process it to get the information in the order that we require it. To do this we first want to process the last item list using some basic nodes. We will need to reverse the list first. Quite simply use the “List.Reverse” node. Then we want to create that crossover effect with the points. To do this we need to divide the list up into sections of 2. We can do this using the “List.Chop” node and use a code block with the number 2 programmed in for the function. You will now notice that we have divided the list into groups of two. To manipulate this data to how we want it to appear we need to use the “List.Map” node with a function of “List.Reverse” programmed into it. IMPORTANT BIT! Make sure that the lacing for the List.Reverse function node is set to cross product or it wont work. the last step is to flatten the information that we have just processed. We do this with the… Yes you guessed it… “Flatten” node.
We are almost there. The last steps are to add the lines and assign 3D elements to the lines. To add the lines between the points that we have just created use the “Line.ByStartPointEndPoint” join up the List.FirstItem to the startpoint input port and the flattened list for the last item to the endpoint input port. next to add the structural framing onto the lines we can use the “StructuralFraming.BeamByCurve” node. Link the Line.ByStartPointEndPoint to the curve input port. Just two mode nodes and that’s us. We need to add an input for the level and structuralframingtype input ports of the BeamByCurve node. For level we use the “Levels” node and for the framing type we can use “Structural Framing Types” node. Specify the level and the framing type that you want and wire it all up.
Click “Run” if you dont have automatic on and the results are…
A fast and automated way of doing a time-consuming task using Dynamo.
Want to know more or perhaps fancy going on a training course look us up at http://www.pentagonsolutions.com.