Getting length of Bolts (Flange to flange connections)

Hi All, I have a problem and I am wondering if dynamo can help.

In my piping project there are flange to flange connections which are supposed to be done using bolts & nuts. Usually superintendents at site spent days figuring out no of bolts with length&size. Information like number of bolts and size are standard and can be embedded in the flange family but the trouble is with length of bolts.
Length of bolt depends on the thickness of the other flange connecting with. e.g a standard flange connecting with a flanged valve - length of bolt will depend on the valve’s flange.
Is there a way dynamo can help identify flanges in the project and its respective connecting element - by knowing this info I can do further maths and develop the script. Please help with any ideas on this.


  1. Is this bolt and flange modeled in the Revit project? If available, the bolt length will be modeled and you can easily take the “Length Parameter” from the project.

  2. If it is not modeled, there must be some data that writes the thickness of the flanges (Excell, Autocad …). All of these entries can be read in dynamo and below you can make the solution you specified.

Hi [Durmus_Cesur],
Thank you for the reply.
Nuts and bolts are not modeled in the project.
Yes data can be extracted from revit family via dynamo. The issue is to identify the element which is placed next to the flange. For example a flange connected with a flanged check valve will have a different bolt length from flange connected with a flanged gate valve.
Challenge is to identify all the flanges in the project and the next flanged element near it. Once I can extract that information, I will be able to accurately calculate lengths of all the bolts within the project. Hope it clarifies.

There must be a database that determines all types of flanges. (Autocad, Excell …) This type of data can be read in Dynamo.
Can you please show us what you have done?

Pretty sure that data could be pulled directly out of the design model. Assuming a good standard was used to build it.

That last bit means that @siddharth.8388 will have to provide a sample model to get meaningful guidance - we can not recreate the conditions in your model for you.

I have created an example pipe system with most common used fittings and a valve.

Different fittings can have different flange sizes, also for pipe flange - size may vary as per pipe diameter.
Length of bolts would be length of both flanges + 3 mm for gasket + 25 mm for bolt (approx)

I know the flange sizes for all standard fittings and pipe fittings. In a real project there will be 100s of instances where a flange is connecting to a fitting or valve, challenge is to identify all those instances and export it to an excel sheet where I can do math and present to the project team.

What I am looking for is some script which can identify all the flanges in the project and the element it is connected with (fittings, valves etc)

Hi @siddharth.8388 ,

  • Open the Dynamo file and read the source of this information (Excell, Autocad …).
  • Sort the flanges by size, pipe diameter.
  • Sort bolts by type of flange.
  • Group the flanges in 2 sets.
  • Find the bolt length with the thickness of the flanges + gasket (+ 3mm).
  • Print the bolt length and the flange type with the bolt in excel.
  • Happy ending.

Note: I don't think you can get guidance in this forum. This forum is not a "do my job" forum. You can get paid guidance if you want someone else to do your job. I have talented friends I know.

@siddharth.8388 please upload the Revit file, not screenshots thereof. For anyone to help point you in the right direction we need your start point. If I build a similar network it will be different and therefore won’t help you at all.

Hi Jacob,

I couldn’t upload the Revit file as here I cannot upload anything above 4 MB.
You can download the file from this link.

No bolts? :face_with_raised_eyebrow:

Assuming you can build your own bolt family with an instance based length parameter that will adjust by based on a value for the elements it has to pass though, and that you’ve already placed every bolt (as you indicated before), this will find the intersecting families, pull the flange thickness from each, sum that value, and set the parameter for the total thickness the bolt has to pass though.


Hi Jacob,
Thank you for the reply. Thats an interesting solution to my problem. “Element.IntersectsElement” is the node I was looking for. Thanks

For clarification, bolts are not modelled in the project as it may make the model slower, its the information which is required.

Similar to the “Element.IntersectsElement” node - which can detect element intersection, is there any other node you know of which can detect element connected or something? Thanks

Not that I am aware of. There is the Pipe.UpstreamElements node but it won’t likely work the way you’re asking it to.