Elbow Pipe Geometry

Hi,

I would like to get the 3D geometry of elements, especially MEP elements in order to get the volumes and surfaces. I succeed to get the solid geometry of almost everything but I can’t get the geometry of an elbow pipe.

With the usual node “element.geometry”, I get only the arc line of the elbow and not the solid so I tried with this following code.

import clr
import math

clr.AddReference("RevitServices")
import RevitServices
from RevitServices.Persistence import DocumentManager
from RevitServices.Transactions import TransactionManager
doc = DocumentManager.Instance.CurrentDBDocument

clr.AddReference("RevitNodes")
import Revit
clr.ImportExtensions(Revit.Elements)
#clr.ImportExtensions(Revit.GeometryConversion)

clr.AddReference("RevitAPI")

from Autodesk.Revit.DB import *


#The inputs to this node will be stored as a list in the IN variables.
dataEnteringNode = IN
ls = [UnwrapElement(IN[0])]
Solids = []
for faminst in ls:
	Solid = []
	geo = faminst.GetOriginalGeometry(Options()).GetTransformed(faminst.GetTransform())
	
	for g in geo:
		#s1 = g.Convert()
		if g != None: Solid.append(g)
		
	Solids.append(Solid)
	
	

#Assign your output to the OUT variable.
OUT = Solids

The result is:

  • Autodesk.Revit.DB.Solid
  • Atodesk.Revit.DB.Arc

When I try to convert with this code, I get nothing (empty list):

However, if I open the family and open Dynamo from there, the usual node “Element.Geometry” give me the solid.

How to get the 3D geometry directly from the project?

Thank you for the help

This is because Dynamo creates the geometry based on the medium detail level from Revit. You should try the Element.Geometry+ node from Clockwork which will allow you to set the detail level for the geometry.

5 Likes

Thank you!

Again thank you T_Pover. I succed to get the elbow geometry. However, for some reason, the value of the computed volume is not correct.

Here is the computation with Dynamo. The units in the project are in [cm,cm^2,cm^3]

And if I compute by hand (A whole torus divided by 4):

V = (2* pi^2 * r^2 * R) / 4

where:
r = 140 / 2
R = 190

V = 4594029.857375 [cm^3]

For a simple pipe of diameter 140 [cm] and length of 100 [cm] the results are:

Dynamo: 15327.9
Theory: 1539335 [cm^3]

Here the error is smaller bu the units don’t match. The units in dynamo are not the same units of the project itsefl?

Thank you for your help.

Hello,

For the units I notice I used a label with an other units. My bad sorry. Dynamo uses the units of the project.

However, I still get wrong values of volume for some pipe fittings. Some families give me the right values and others give me a value exactly 7 times bigger (=1.75* the whole torus).

Here is one of those families: https://ufile.io/9eqv0v3o

Why it gives me this value and how to get the correct one?

Thank you for your help.