.NET
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Union of Region using C# .NET

2 REPLIES 2
SOLVED
Reply
Message 1 of 3
artillis_prado
299 Views, 2 Replies

Union of Region using C# .NET

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

2 REPLIES 2
Message 2 of 3
Jeff_M
in reply to: artillis_prado

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
Message 3 of 3
artillis_prado
in reply to: Jeff_M

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.

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

AutoCAD Inside the Factory


Autodesk Design & Make Report