Numbering Piles using Dynamo – Part 1 (No programming knowledge required)

Hi! How are you doing? I trust you are well. It’s been a few weeks since I posted something relevant to Revit. That’s because I have been busy these past weeks.

Now I find some time to document the process of looking at assigning unique tags for all my piles using Dynamo. This is for a new project consists of piled foundations and since I’ll be using Revit 2017, some apps or plugins are no longer available for use for this version. Dynamo help is my only option as eventually, I’ll be numbering my piles anyway. So I’ll make a test first before actually applying this to the project. This is not only for my own reference in the future but to share with you the process as well and hope you’ll find this useful. If you like it, don’t forget to give it a ‘Like’. If you have some knowledge to share, don’t be shy and keep it yourselves, help others learn from your hidden knowledge and experiences. Let’s begin!

First I open my Revit and I started placing piles and pile caps in random and in different pile cap types as shown. They also come in different pile diameters.

Next, I’ll create a Structural Foundation Schedule.

I used Type, Mark and Type Mark

Then we have a built-in text parameter within our company Revit Structural Template called ‘RUKViewFilter’ which I’ll use to specify whether the element is a Pile or Pile Cap. Any text parameter will do actually.

Add a little bit of formatting to schedule Piles only.

Then I rename the schedule to ‘PILE SCHEDULE’ and add the other necessary parameters I normally use to create Pile Schedule. Mine looks like the one below without the columns for the loadings.

While the ‘PILE SCHEDULE’ is still open, I highlight all the piles then I go to my view where I can only see my piles (in my case ‘PILE LEVEL’), select all the piles and assign a tag by ‘Mark’.

And I should have something like this:

The goal of this demonstration is to provide a unique ‘PILE REFERENCE’ for each pile and to complicate things, I want the Pile Reference to be added in ascending order which starts from the one nearest to (0,0) coordinates. The naming should start by looking at the Y-coordinates first that is nearest to origin then followed by X-coordinates. I manually assigned the tags for each pile (see below) and I’ll see if I’ll be able to get the same tagging arrangement using Dynamo.

Let me hit ‘Undo’ button to remove all the tags because I want Dynamo to do it for me.

After that, let me jump to Dynamo and begin the exciting part: building the graph or script.

Now open Dynamo.

If you have two or more versions of Dynamo installed on your machine, use the latest one.

Create ‘New’ file

Don’t forget to save the file first.

Next, I begin with pulling out all the structural foundation categories.

As you can see, I have piles and pile caps. I am after only with piles and therefore I need a way to separate them. If you remember I have a filter called ‘RUKViewFilter’ which allows me to specify whether the element is a pile or a pile cap.

Next node I need is called ‘Element.GetParameterValueByName’ and under the ‘parameterName’ I’ll connect the string called ‘RUKViewFilter’.

Next is to split PILE to PILE CAP. I need a node called ‘==’. What is this node does is to compare x input to y input and gives you a true or false result.

Then I need a node called ‘List.FilterByBooMask’ which separate true and false results based on the input list.

Now I need the location in XYZ coordinates of all my RC piles. To do that I need a node called ‘FamilyInstance.Location’.

Then I’ll isolate the Y-coordinates.

And next is to use ‘List.SortByKey’ node to sort the Y-coordinates in ascending order.

However, I need a list to connect to the ‘list’ input of my ‘List.SortByKey’ node. Therefore I need to create a list using ‘List.Create’ node and I want to list down the pile type and the coordinates.

Transpose the list using ‘List.Transpose’ node so I’ll have the pile type and it’s corresponding coordinate location.

Then connect the transposed list to the ‘List.SortByKey’ node as shown.

Now I have a list of piles in ascending order with respect to the Y-coordinates.

Let me do sort my piles in ascending order with respect to the X-coordinates and I should have something like the one below.

Now here is where the part-1 will stop. Next step is to figure out how to sort my list of piles in Y-direction first and followed by X-direction simultaneously instead of having two separate lists in ascending order with respect to Y-coordinate and X-coordinate respectively.

I came across in one of the posts on LinkedIn from Mr.Alexander Tohidi about the use of an algorithm called ‘Bubble Sort’. Here is the link to his interesting post on LinkedIn:

Just to give you a bit of idea, ‘Bubble sort’ is a simple sorting algorithm. This sorting algorithm is a comparison-based algorithm in which each pair of adjacent elements is compared and the elements are swapped if they are not in order.

Another way to do this is to export my list to the spreadsheet and sort it there then assign my instance pile reference parameter and push it back to Revit using ‘Excel.ReadFromPile’ node in Dynamo (this requires another Dynamo file).

I’ll post the part-2 as soon as I have completed the test.

If you know a better way or if you have any questions just let me know and I’ll do my best to answer!

Positive SSL