List sorting and grouping by Assembly Name then Mark, then multiple Summations

I’m attempting to, from an assembled pipe run, with Mark numbers starting from 1 and running up each assembly, collectivized based on Assembly Name and organized by Ascending Mark numbers, run a summarizing calculation of 6 calculations, for every assembly in the System.

The 6 Calculations I’m seeking to run are as follows: {=Parameter Values or Names}

  1. {Digi_Length} of {Mark} 1 of the {Assembly_Name}. Label “Len_A”
  2. SUM the {Digi_Length} for {Mark}'s 1,2, & 3 of {Assembly_Name}. Label ‘Length_B’
  3. SUM the {Digi_Length} for {Mark}'s 1,2,3,4 & 5 of {Assembly_Name}. Label ‘Length_C’
  4. SUM the {Digi_Length} for {Mark}'s 1,2,3,4,5,6 & 7 of {Assembly_Name}. Label ‘Length_D’
  5. SUM the {Digi_Length} for {Mark}'s 1,2,3,4,5,6,7,8 & 9 of {Assembly_Name}. Label ‘Length_E’
  6. SUM the {Digi_Length} for ALL {Mark}s of {Assembly_Name}. Label ‘Total Length’

I’m able to use a Multi Category Schedule in Revit to half display what I need.

ACR-PipeLengthCalcs.dyn (60.9 KB) Thanks for any help!

1 Like

Okay i think i understand what you are trying to do.
Let me have a try at this. :slight_smile:

PS: please also upload your corresponding Revit Project next time!

Hey Mjacobson,

I think i have create the script you are looking for!
I have build this script up from almost fully OOTB nodes, but i needed to use a handful of ClockWork Package nodes, so make sure to install that Package!

Firstly i started by extracting all the “Structural Framing” Elements by Category. (In your case Piping Networks.)
When i got all these elements i extracted all parameters which contain in the name “Family and Type”. (In your case Assembly Name).
Then i used these parameter values to Sort all Elements by their corresponding “Family and Type / Assembly Name”.

After this i sorted all the families by their name so i have an order like: 1,2,3 or A,B,C or, in your case, all Assembly Names in Order.

Now we have a split up list, sorted alfabetically. From this we extract all parameters once again to Sort these lists, now becoming sublists, by their Mark. In your Case 1 to 9, in my case A to I. The concept is the same.

I do this for the Mark and for the “Elevation at Bottom”, in your case “Digi Length”, because we need them both. :slight_smile:

Because we want the marks always to be in the right order (1…9), do we sort the list by their parameter value. Because we do not need the mark values but the Digi Length values, we sort the Digi length parameter by the sorting output from the Mark.

Now we have a list, with sublists which represent Assembly Names with Marks within them. List 0 is Mark 1 and so forth. Because these values are now always sorted by their Mark level we can make the Sum calculations for each amount you specified in this Topic (1, 1 to 3, 1 to 5, 1 to 7, 1 to 9 and Total Amount.) This looks like this:

Now we have gathered all the data we need and the only thing left to do is to create an export to Excel to be able to read this data in a comfortable way. This is done in this way:

And this will look like this in Excel:

And here is the Dynamo File, you will need to change some small bits but that is all:
Dynamo Forum Post 15-01-2020 AssemblyName Then Mark Then Sum MJacobson71E.dyn (156.9 KB)

If you didnt understand some parts let me know and i will try to explain to the best of my abilities.

  • Daan