Creating Geometry in Revit using Lists and Lacing

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.List Create 1Now 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;

Laicng Before

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.List Create 2

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.

List Create 3

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.

List Create 4Click “Run” if you dont have automatic on and the results are…

Revit result.

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.

Thanks

Matt Hull

 

Advertisements

BS1192 Naming in Revit with Dynamo

Populating Revit with BS1192 drawing numbers with Dynamo.

Ok, so just about everyone that works within the UK AEC industry is aware of the government target for achieving BIM Level 2 maturity by 2016. What is required to achieve BIM Level 2 is outlined within PAS1192-2:2013.

For those of us within the industry using Revit and working to the UK Government mandate to be BIM Level 2 may also be aware of the BS1192 Drawing Naming and Numbering convention for Drawings and documentation.

For most this will look familiar;

Project Originator Zone Level File Type Role Number File Container
PS01 GP 00 01 M2 M 00001 PS01-GP-00-01-M2-M-00001
PS01 GP 00 01 M2 E 00001 PS01-GP-00-01-M2-E-00001

This is the 7 field library naming that provides a unified approach to identifying objects across data sets and associated tools, but how do we get this from an excel spreadsheet into Revit at the click of a button?

First of lets start Revit 2017 and launch Dynamo through Revit. This is done through the Manage Tab – Visual Programming Panel and selection Dynamo form the drop down. Click on the new Lets start a new Dynamo file.

Dynamo 1

So lets add some nodes to bring our Excel information into Dynamo. The nodes that we need to link the excel spreadsheet are first of all “File Path” node. This allows us to link in an external file. “File.FromPath” allowing us to create an object from the linked file. We then have to get Dynamo to read from the excel file. To do this we use the “Excel.ReadFromFile” Node. We Also want to tell Dynamo what sheet in the excel spreadsheet we are wanting to extract the data from. To do this we add a “String” node and give the string the value of the sheet name. For example if the sheet is named “DRAWING NUMBERS” then this is what you enter into the string node. Bare in mind that this is case sensitive. Once we have these starting nodes loaded lets joint them together.

Dynamo 2

Right, so now that we have linked the required information into Dynamo, we now need to organize it. We need to list the data that is contained within the excel spreadsheet, to do this we use the node “List.Transpose”. From this list we can start to get items from the spreadsheet use the “List.GetItemAtIndex” and user the “Number” node to tell Dynamo what column within the spreadsheet to reference to. So a 0 in the number node will reference column 1. So let’s join them together.

Dynamo 3

Now we have the file linked into Dynamo and we are telling it where to look in the spreadsheet. now lets take that from Dynamo and populate some sheets with the information within the excel document. To do this we require 3 nodes. the first one is the “Sheet.ByNameNumberTitleBlockAndView” allowing Dynamo to create the sheets within Revit. You need to then specify the titleblock family that you want to use. For this example i have specified the pre-loaded example. To specify the titleblock you need to load the “Family Types” node and specify the family. To  get this to work you also need to place a view on one of the sheets. Use the “Views” node to specify a view to add to a sheet. This will only add the selected view to one of the sheets. Add them all together and you are almost there.

Dynamo 4

Click “Run” if you haven’t got automatic on and check the project browser to see the populated sheets with the numbers from the spreadsheet.

Dynamo 5

There we go. A simple and fast way of populating titleblocks with their file container number all from a spreadsheet.

Want to know more or perhaps fancy going on a training course look us up at http://www.pentagonsolutions.com.

Thanks

Matt Hull