Solids in the Revit Element

Hello,
How shall we get the solid in a Revit element which is defined for fine detail level. Currently when we select an element, the “Solids in this element” node gives only the solid defined for medium detail inside the family. Suppose if we set the visibility of one solid in medium detail and other solid in fine detail inside the family, the dynamo gives only the solid defined for medium detail. Is there any possibility to extract the solid defined for the fine detail?

Hi,

it is possible with Python for sure.
When extracting geometry of the family instance you have to set the options variable to accept only elements from Fine Detail Levels.
Try this:

import clr

clr.AddReference('RevitAPI')
import Autodesk
from Autodesk.Revit.DB import *

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

opts = Options()
opts.DetailLevel = ViewDetailLevel.Fine

gElem = UnwrapElement(IN[0]).get_Geometry(opts)

solids = []

for gObj in gElem:
	if isinstance(gObj,GeometryInstance):
		for iObj in gObj.SymbolGeometry:
			if isinstance(iObj, Solid):
				solids.append(iObj.ToProtoType())		


OUT = solids
3 Likes

Yes, this is working. Thanks a lot !

1 Like

Thank you! But it doesn’t work for lists in IN[0]…

You need for loop among the required list like below :

A = IN[0]

for i in A:
UnwrapElement(i]).get_Geometry(opts)

Something wrong…

you have to append results to empty list

A = IN[0]
gelem =

for i in A:
gelem.append(UnwrapElement(i]).get_Geometry(opts))

Ok! this part works correctly, gElem returns list with sublists. But something wrong with thу second part, starts with for… geom returns Empty List