Author Topic: To find each closed boundary of selected object  (Read 39504 times)

0 Members and 1 Guest are viewing this topic.

Stefan

  • Bull Frog
  • Posts: 319
  • The most I miss IRL is the Undo button
Re: To find each closed boundary of selected object
« Reply #15 on: April 09, 2014, 02:40:06 PM »
stefan,

Great routines, specially like Enclosed Polylines.

ymg
Thank you, ymg.


tieptouch

  • Guest
Re: To find each closed boundary of selected object
« Reply #16 on: May 26, 2014, 09:11:37 AM »
Hi Stefan,
* Union Polylines.LSP
* Enclosed polylines.LSP
These routines don't work for Autocad 2008...please help me

Stefan

  • Bull Frog
  • Posts: 319
  • The most I miss IRL is the Undo button
Re: To find each closed boundary of selected object
« Reply #17 on: May 26, 2014, 03:49:58 PM »
Hi Stefan,
* Union Polylines.LSP
* Enclosed polylines.LSP
These routines don't work for Autocad 2008...please help me
Both works on Acad2007.
Please check if all objects are in WCS.

tieptouch

  • Guest
Re: To find each closed boundary of selected object
« Reply #18 on: May 27, 2014, 10:35:37 PM »
Hi, Stefan
I get  " ; error: bad argument type: VLA-OBJECT #<SUBR @0ca52d34 ACDOC> "    at the command line,
i use acad 2007

Stefan

  • Bull Frog
  • Posts: 319
  • The most I miss IRL is the Undo button
Re: To find each closed boundary of selected object
« Reply #19 on: May 28, 2014, 03:32:18 AM »
Hi, Stefan
I get  " ; error: bad argument type: VLA-OBJECT #<SUBR @0ca52d34 ACDOC> "    at the command line,
i use acad 2007
Change variable name acDoc in both lisp files
Code: [Select]
(defun c:UNIP ( / *error* i lst ms r1 reg ss sysvar prop)
  (or *acDoc* (setq *acDoc* (vla-get-activedocument (vlax-get-acad-object))))
.......
... or make it local
Code: [Select]
(defun c:UNIP ( / *error* acDoc i lst ms r1 reg ss sysvar prop)
  (setq acDoc (vla-get-activedocument (vlax-get-acad-object)))
.......

 Edit: :-D
« Last Edit: May 28, 2014, 05:01:28 AM by Stefan »

tieptouch

  • Guest
Re: To find each closed boundary of selected object
« Reply #20 on: May 28, 2014, 03:35:58 AM »
Thanks alot!!!!!!!

Stefan

  • Bull Frog
  • Posts: 319
  • The most I miss IRL is the Undo button
Re: To find each closed boundary of selected object
« Reply #21 on: May 28, 2014, 05:10:42 AM »
You're welcome.


I've made some corrections in my previous post. You should update your files accordingly.

tieptouch

  • Guest
Re: To find each closed boundary of selected object
« Reply #22 on: May 29, 2014, 02:10:12 AM »
Can you help me a routine as example:
--> Select en2 (polyline) and en1 (Horizontal line), then return list entity names of boundaries 1, 2, 3 (which below Horizontal line en1)
Thanks so much!

ribarm

  • Gator
  • Posts: 3225
  • Marko Ribar, architect
Re: To find each closed boundary of selected object
« Reply #23 on: February 09, 2016, 10:40:47 PM »
This topic could be continued with this one :

https://www.theswamp.org/index.php?topic=49453.msg545846#msg545846

M.R.
Marko Ribar, d.i.a. (graduated engineer of architecture)

:)

M.R. on Youtube

xxfaxx

  • Guest
Re: To find each closed boundary of selected object
« Reply #24 on: May 21, 2018, 03:48:32 PM »
Lee and Steffan thanks for the lisps
Steffan both of your lisps were exactly what i was looking for
thanks again

xxfaxx

  • Guest
Re: To find each closed boundary of selected object
« Reply #25 on: May 21, 2018, 06:11:01 PM »
hello again
I was wondering if a little improvement could be made to the routine.

When we use this routine to make boundaries and we have two rows of boundaries to be made (one row adjacent to the other) , and lets say we have a 10x10 square box, and next to it we have 2 5x5 square boxes, so the boundary of the 10x10 square box will have an extra vertex in the middle of the adjacent line next to the two 5x5 square boxes.

Is there a way we can stop that from happenning??? it gets in the way when we want to put dimensions to the boundaries.

AwAD

  • Guest
Re: To find each closed boundary of selected object
« Reply #26 on: October 16, 2018, 12:10:06 PM »
This one works with arcs and circles, yet only in WCS.
It is supposed to work in any UCS, but for some reasons it didn't find all intersections.

In addition, this method creates a series of small regions AND a larger one, enclosing all the others, and it should be deleted.
Gian's method adds up all areas and deletes the one who's area is half; my method deletes the object with the largest area.
Both methods fails if the selection set contains multiple disjoint sets.

I've attached a second lisp, which has (almost) nothing to do with the subject, but it uses some parts of the first one, regarding regions creation and transforming regions in polylines. Basically, it is about union polylines.

hello Everyone,
thank's a lot for Stefan for his routine "Enclosed polylines.LSP" IT IS GREAT, however I encountered an error "Error: AutoCAD.Application: Invalid input".
I selected lines that are not intersected but touch each other at the beginning / end or share the same vertexes.
the same error occurs when I select lines that are far from each other in a way that is impossible to find closed polylines.
anther thing that might be irrelevant is that this routine http://www.theswamp.org/index.php?topic=10370.0#lastPost
works with the same lines.
also the command boundary works as well.
I attached a photo of the lines.

Stefan

  • Bull Frog
  • Posts: 319
  • The most I miss IRL is the Undo button
Re: To find each closed boundary of selected object
« Reply #27 on: October 16, 2018, 12:47:05 PM »

hello Everyone,
thank's a lot for Stefan for his routine "Enclosed polylines.LSP" IT IS GREAT, however I encountered an error "Error: AutoCAD.Application: Invalid input".
I selected lines that are not intersected but touch each other at the beginning / end or share the same vertexes.
the same error occurs when I select lines that are far from each other in a way that is impossible to find closed polylines.
anther thing that might be irrelevant is that this routine http://www.theswamp.org/index.php?topic=10370.0#lastPost
works with the same lines.
also the command boundary works as well.
I attached a photo of the lines.

Hello
Make sure all your lines are in the same plan, preferably WCS. Set UCS to WCS.
Check if all are starting and ending at Z=0.
Check if all ends are truly meeting.
Run OVERKILL first to be sure there are no overlapping segments.
If it fails again, post a dwg sample. I'll take a look to see what's wrong.
Good luck.

AwAD

  • Guest
Re: To find each closed boundary of selected object
« Reply #28 on: October 16, 2018, 01:15:25 PM »

hello Everyone,
thank's a lot for Stefan for his routine "Enclosed polylines.LSP" IT IS GREAT, however I encountered an error "Error: AutoCAD.Application: Invalid input".
I selected lines that are not intersected but touch each other at the beginning / end or share the same vertexes.
the same error occurs when I select lines that are far from each other in a way that is impossible to find closed polylines.
anther thing that might be irrelevant is that this routine http://www.theswamp.org/index.php?topic=10370.0#lastPost
works with the same lines.
also the command boundary works as well.
I attached a photo of the lines.

Hello
Make sure all your lines are in the same plan, preferably WCS. Set UCS to WCS.
Check if all are starting and ending at Z=0.
Check if all ends are truly meeting.
Run OVERKILL first to be sure there are no overlapping segments.
If it fails again, post a dwg sample. I'll take a look to see what's wrong.
Good luck.

Thank's a lot sir for your fast reply,
I've tried your advise with no luck unfortunately, however when I extend the lines over each other to be intersected the routine work fine "in the first one" & at the second one, I enthroned all the lines are touching each other but with no luck also.   

Stefan

  • Bull Frog
  • Posts: 319
  • The most I miss IRL is the Undo button
Re: To find each closed boundary of selected object
« Reply #29 on: October 16, 2018, 03:47:10 PM »
- The outer limits, in layer US-SITE-RWAY, are not always closed. Isolate layer, try  PEDIT - Multiple, <select all>, Join. You will see, not all the resulting polylines are closed. Fix them and then you can use the resulting polylines or you can explode them.
- After that, extend both ends of the US-SITE-LAND-PROP lines a few units, to be sure they intersect the border. In your sample, a lot of them are not exactly on the border, sometime missed by just 0.0002 units.
- Use overkill, ignoring layer, color, linetype etc.
- Process one island at the time.
Use the attached lisp.
You will still get some errors, especially in the curved islands... The tangent lines and arcs are not connected, not tangent, or fails for no particular reason, even for some Autocad native commands.