Union of Region using C# .NET

artillis_prado
Enthusiast
Enthusiast

Union of Region using C# .NET

artillis_prado
Enthusiast
Enthusiast

And I want to use the above union command for more than 2000 regions. I can do it manually, but I would like to know how to do it using the API.

artillis_prado_0-1718395060734.png

0 Likes
Reply
Accepted solutions (1)
300 Views
2 Replies
Replies (2)

Jeff_M
Consultant
Consultant
Accepted solution
region.BooleanOperation(BooleanOperationType.BoolUnite, otherregion);

 

This is what I use to unite many regions:

                var regions = Region.CreateFromCurves(polys);
                var overall = new DBObjectCollection();
                foreach (Region reg in regions)
                {
                    try
                    {
                        regions.Remove(reg);
                        foreach (Region x in regions)
                        {
                            if(!x.IsNull)
                                reg.BooleanOperation(BooleanOperationType.BoolUnite, x);
                        }
                        if (!reg.IsNull)
                            overall.Add(reg);
                    }
                    catch { }
                }
Jeff_M, also a frequent Swamper
EESignature
0 Likes

artillis_prado
Enthusiast
Enthusiast
My question is whether there is a way to handle a larger quantity, like 2000, 3000, or 4000, because the way I am doing it now takes a long time.
0 Likes