Floor Edges through Solid with Ptyhon

Hello everybody:

I’m working with Python trying to get all vertex of floors. First I’m extracting the floor as solid and in principle everything is OK:

parkingFloors = FilteredElementCollector(doc).OfCategory(BuiltInCategory.OST_Floors).WhereElementIsNotElementType().ToElements()
    parkingFloors = []

    test = []

    TransactionManager.Instance.EnsureInTransaction(doc)

    for parkingFloor in parkingFloors:
        opts = Options()
        opts.ComputeReferences = True
        solid = parkingFloor.get_Geometry(opts)
        test.append(solid)

    TransactionManager.Instance.TransactionTaskDone()

    OUT = test

But when I try to get the Edges (property of solids) I get the next error:

allFloorInstances = FilteredElementCollector(doc).OfCategory(BuiltInCategory.OST_Floors).WhereElementIsNotElementType().ToElements()

test = []

TransactionManager.Instance.EnsureInTransaction(doc)

for parkingFloor in parkingFloors:
    opts = Options()
    opts.ComputeReferences = True
    solid = parkingFloor.get_Geometry(opts)
    floorEdges = solid.Edges
    test.append(solid)

TransactionManager.Instance.TransactionTaskDone()

OUT = test

image

How do you extract the points or the edges of a floor? Please, before I start this new topic I looked for and I tried solutions for several hours. If I was not lucky sorry.

Thanks in advance.

You need to loop through all the solids you got:

doc = DocumentManager.Instance.CurrentDBDocument
uidoc=DocumentManager.Instance.CurrentUIApplication.ActiveUIDocument

parkingFloors = FilteredElementCollector(doc).OfCategory(BuiltInCategory.OST_Floors).WhereElementIsNotElementType().ToElements()

test = []

TransactionManager.Instance.EnsureInTransaction(doc)

for parkingFloor in parkingFloors:
	opts = Options()
	opts.ComputeReferences = True
	solid = parkingFloor.get_Geometry(opts)
	
	for s in solid:			
		test.append(s.Edges)

TransactionManager.Instance.TransactionTaskDone()

OUT = test

GetSolidEdges

Ah OK, I understand. Thanks a lot! :slight_smile: