-1

Converting Autodesk.Revit.DB.Element to Autodesk.Revit.DB.Solid

I already tried to extract all solids from element, and that's was okay, I had a list of 2 - 10 solids. But the problem is that I cannot merge these solids to one using BooleanOperationsUtils.ExecuteBooleanOperation, because I catch

Autodesk.Revit.Exceptions.InvalidOperationException:

// Failed to perform the Boolean operation for the two solids. This may be due to

// geometric inaccuracies in the solids, such as slightly misaligned faces or edges.

BTW, also i see some solution to swap order of solids to merge, but this isnt working when i have 10 and more solids in element(for example some bottle or vase or complicated chair)

Maybe anyone knows about this issue and can help me?

kiryha
  • 1

1 Answers1

0

Have a look to this: https://github.com/Autodesk/revit-ifc/blob/master/Source/Revit.IFC.Import/Geometry/IFCGeometryUtil.cs You can adapt the code, the idea is to move slightly the second solid to a choosen direction ( for exemple Z), to undo geometric tolerance problems. It works for me picture2