Merge or combine filled regions

Merge or combine filled regions

ameer.mansourWAK8Y
Advocate Advocate
3,009 Views
4 Replies
Message 1 of 5

Merge or combine filled regions

ameer.mansourWAK8Y
Advocate
Advocate

hi 
any thoughts on merging or combining filled regions to be a single region? using Revit API

ameermansourWAK8Y_1-1653468702228.png

 

 

Accepted solutions (1)
3,010 Views
4 Replies
Replies (4)
Message 2 of 5

RPTHOMAS108
Mentor
Mentor

Yes this is actually quite an easy task despite outward appearance.

 

The filled region geometry contains a flat solid (solid with single planar face).

 

Therefore you can extract the solids

use BooleanOperationsUtils.ExecuteBooleanOperation with Union

You would have to union each result of the operation in turn with the next solid to union

Then extract the Edges as CurveLoops from the face of the new solid and create a filled region with it.

Message 3 of 5

RPTHOMAS108
Mentor
Mentor
Accepted solution

If you can't get it to work that way due to the BooleanOperationsUtils not liking flat solids then.

 

You can extract the current face edges as CurveLoops then extrude them with:

GeometryCreationUtilities.CreateExtrusionGeometry(IList(Of CurveLoop), XYZ, 1)

To create solids with a thickness.

 

Carry out union operation on those to create new solid. Finally on the new solid extract the edge CurveLoops from the face with face normal opposite to the extrusion direction (original plane extruded away from).

0 Likes
Message 4 of 5

ameer.mansourWAK8Y
Advocate
Advocate

that is a good idea instead of doing the hassle of merging algorithms.
it works in most cases but in some, I get this exception and I don't know what is it and what to do!

ameermansourWAK8Y_0-1653570934214.png

 

0 Likes
Message 5 of 5

MiguelVJC82W
Enthusiast
Enthusiast

Did you ever figure this out?

0 Likes