Revit API Forum
Welcome to Autodesk’s Revit API Forums. Share your knowledge, ask questions, and explore popular Revit API topics.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

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

1 REPLY 1
Reply
Message 1 of 2
FrankHolidaytoiling
272 Views, 1 Reply

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

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

 

Labels (5)
1 REPLY 1
Message 2 of 2

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

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

Post to forums  

Forma Design Contest


Rail Community