Calculating `ConduitFitting` length

Performing system analysis on conduits in Revit can be a drag, apparently; it’s not possible to create a combined schedule of conduits and fittings with accurate total run lengths. pyRevit to the rescue!

I’m making some MEP tools to help address this and got pretty far this weekend inspecting conduit elements and even pulling up the conduit run data associated with them. I can see the total run length, which seems accurate, but when breaking down the individual element lengths I ran into the issue of not having a simple way of getting fitting lengths.

I have a simple project that I’m testing against, with a conduit system involving two straight runs of 100 ft. and 12 ft. and a single 90 deg. bend, as shown:

My script reports the following for the conduit run:

<Autodesk.Revit.DB.Electrical.Conduit object at 0x000000000000AA1A [Autodesk.Revit.DB.Electrical.Conduit]>
Conduit run ID: 366794
Conduit run: <Autodesk.Revit.DB.Electrical.ConduitRun object at 0x000000000000AA1B [Autodesk.Revit.DB.Electrical.ConduitRun]>
Conduit run length: 63.3472527470

This indicates that the fitting length is included in the total, for a length of 3.347 ft. For that fitting, however, my script reports the estimated bend length (using bend_length = (pi * rad_inch * ang) / 180) as being:

Type: <Autodesk.Revit.DB.FamilyInstance object at 0x000000000000AA1D [Autodesk.Revit.DB.FamilyInstance]>
Id: 366721
Level: Level 1
Outside diameter:
RunId(s): [366794]
Angle (deg.): 90.0
Bend radius (ft): 1.52083333333
Bend len. (in.): 28.6670329640

From what I now understand the fittings can only be an estimate due to the way Revit treats such family instances, but I’m trying to understand the large difference between the calculated length above of 28.6670329640 in. and the 40.167032964 in. I should get as the balance of the total run.

I’ve read some older posts on Dynamo forums discussing this and based my approach on their recommendation, but it just doesn’t seem accurate enough to be confident with.

It’s been a while so I’m going mostly from memory. Here are the steps on how I accomplished it.

  1. I added an arc length annotation to the family. See image.
    *Edit: I had the wall centerlines option selected.
    Click 1 = The centerline of the elbow.
    Clicks 2 & 3 = The flat edge of the sweep that makes the elbow.
  2. Assigned that annotation to a reporting parameter.

    4.The parameter can then be looked up and summed as you traverse the conduit run with the Revit API.

Hope this helps anyone trying to accomplish finding the conduit run length!

*Edit
I should add that this will give you the center line distance arc length through the elbow. So the accuracy is on point. :ok_hand:

Thank you, @Giuliano, I will try this next. Does this mean that the fitting centerline cannot be reliably accessed by the API on its own?

I don’t know the answer to that. I edited my conduit elbow family to get the center line arc length long before I was dabbling with the Revit API. But I eventually wanted to achieve the same thing you are attempting to do in getting the conduit run length. And it simplified it greatly to just have a parameter with the accurate length to be able to sum with my conduit lengths.

PS
You might as well get the total run degrees while you’re at it. Since the NEC limits conduit to 360°. Plus other specs might have a lower limit.

All in all the tool I have gets the run length, total degrees, and then pushes that and all other parameter information to the rest of the connected elements in the conduit run. If there are any discrepancies, a gui pops up to let the user choose what value to keep or it lets them ignore the discrepancy and that parameter is ignored.