Dynamo script works with PickObject but fails with multiple curtain panel selection

Hello,
Your problematic panel is the one with ID 255449.

Why?

I don’t know.

Here’s a way to retrieve the face geometry:

The code to retrieve the geometry is by Mr. Poupin.

You’ll need to adapt it if you’re sending a list or a list of lists.

Have a good day.
Sincerely,
Christian Stan

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

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

cp=UnwrapElement(IN[0])

def getSolidfromGeo(elem):
	opt = Options()
	opt.ComputeReferences = True
	opt.IncludeNonVisibleObjects = True
	geoSet = elem.get_Geometry(opt)
	#
	for geo in geoSet:
		if isinstance(geo,Solid) and geo.Volume > 0 :	
			return geo, "Geometry"
	for geo in geoSet:
		if isinstance(geo, GeometryInstance):	
			outSolid = []
			geoSetInst = geo.GetInstanceGeometry()
			for geoI in geoSetInst:
				if isinstance(geoI,Solid) and geoI.Volume > 0:
					outSolid.append(geoI)
			# Order the list by ascending volume
			outSolid.sort(key = lambda x : x.Volume )
			print(len(outSolid))
			#Retrieve the Revit faces of the largest [-1] of the volumes
			lfr=outSolid[-1].Faces
			#Transform the Revit faces To Faces Dynamo
			lfd=[f.ToProtoType()[0] for f in lfr]
			return lfr,lfd, "GeometryInstance",geoSetInst
	return None, None


OUT = getSolidfromGeo(cp)