# Calculation of Pipe Quantities

Dear Dynamo team,
i am planing to create program to calculate pipe quantities of project. Problem is there is 3 different types of pipes and each pipe type have 3 different sizes. So for example output should be like below (Output should be sorted also). Have you any suggestions? Should i use python for this or Dynamo is enough for this? (I don’t know python yet. )

Copper Pipe
6.35 - 10 meter
12.7 - 25 meter
22 - 15 meter

Steel Pipe
15 - 50 meter
20 - 25 meter
25 - 30 meter

PVC Pipe
50 - 30 meter
100 - 10 meter
150 - 45 meter

Hi @kvusal

You can retrieve all the pipe types by using “Element.Type” node and then sort them by type name and at last use List.Count node with lacing to longest to get the quantities of each type. Hope it helps!

Dear Kulkul, count will work? We need to make Dynamo to calculate total meter of pipes for specified size and type.

Hi @kvusal ,
you could do something like this:

1 Like

Sorry @kvusal I thought your trying to get count. @Mostafa_El_Ayoubi Solution should work for you.

1 Like

Thanks a lot.

Dear Mostafa,
I tested script you send by photo. It did good on the result of material type pipe Length Calculation. However did not mentioned any sizes in the result. I mean:
Copper Pipe : 50 m
Steel Pipe : 105 m
PVC Pipe: 85 m

But what i wanted:
Copper Pipe
6.35 - 10 meter
12.7 - 25 meter
22 - 15 meter

Steel Pipe
15 - 50 meter
20 - 25 meter
25 - 30 meter

PVC Pipe
50 - 30 meter
100 - 10 meter
150 - 45 meter

@kvusal,
you can use the same logic and group by diameter value :

1 Like

This can easily be done with a Revit schedule. I’m curious what advantage using Dynamo has over a schedule.

1 Like

Dear Jason,
You are right. What i am doing to reduce time lost and making mistake during preparing BOQ. I mean i am tring to prepare BOQ directly from Dynamo.

Hello Mostafa.
I am using the script you have given its works superbly well thanks for that i am a beginner in dynamo is there any node i can write this to excel i tries write to file but its not working please help me out , thanks in advance