split selected 2d lines into closed loops to create separate filled regions

split selected 2d lines into closed loops to create separate filled regions

FrankHolidaytoiling
Advocate Advocate
777 Views
1 Reply
Message 1 of 2

split selected 2d lines into closed loops to create separate filled regions

FrankHolidaytoiling
Advocate
Advocate

I would like to split selected lines in a family into 1 or more curveLoops to add to a collection and iterate over creating filled regions.

I can achieve this for one curved loop after implementing code solutions from the Building coder blog, however I was wondering what the best approach if I get lines from a selection rectangle over the lines in 2d.

 

Each shape within the selection window would be a separate filled region, an even more automatic method might be to use a collector of all lines in view and convert them into filled regions if they have closed loops? 

FrankHolidaytoiling_0-1651058950308.png

 

778 Views
1 Reply
Reply (1)
Message 2 of 2

jeremy_tammik
Alumni
Alumni

I would suggest that the answer is Yes.

 

I hope this helps 🙂

 

Maybe do some research on how to detect closed loops in a given collection of line segments, e.g., search the Internet for things like "geometry find closed loop line segment":

 

https://duckduckgo.com/?q=geometry+find+closed+loop+line+segment

   

Jeremy Tammik Developer Advocacy and Support + The Building Coder + Autodesk Developer Network + ADN Open