Missing and Overlapping Polylines

Missing and Overlapping Polylines

Anonymous
Not applicable
1,067 Views
3 Replies
Message 1 of 4

Missing and Overlapping Polylines

Anonymous
Not applicable

Can anyone help me with two LISP routines I need:

 

1st - create a hatch where a Polyline is missing. On sample attached, on left group, as you can see, there's a thin stripe in a middle on objects, and I need to place a solid-filled hatch in order to make it visible, and easily detectable spaces where a polyline is missing.

 

2nd - Turn Yellow overlapping polylines. On right group of attachment, you can see two overlapping polynies (in DASHED line type to make it easier on this sample). I need Autocad recognized those two overlapping polylines, and turn them yellow for an easy-find system.

 

 

I would appreciate if anyone help me on this task.

 

thanks!

 

0 Likes
1,068 Views
3 Replies
Replies (3)
Message 2 of 4

Kent1Cooper
Consultant
Consultant

On the 2nd item:

 

That's something of a challenge, because obviously the easy  thing to check for -- whether they touch  each other, i.e. intersect in any  way -- doesn't qualify as overlapping.  How challenging it is could depend in part on the answers to some questions:

 

Are they always and only rectangular  Polylines, of 4 and only 4 vertices and closed, as in your sample?

 

Are they always orthogonally oriented  as in your sample?

 

If the answers to both questions are Yes, your sample situation could be detected fairly easily, because one has a vertex inside the other [the red dot here], and that could be determined from their entity data perhaps also using their bounding boxes.

overlap1.png

If angled ones or non-rectangular ones or arc segments might be involved, that comparatively simple kind of determination is out the window.

 

If they might sometimes overlap in this fashion:
overlap2.png

that would be harder to figure out, because to the degree that they intersect, some vertices of one would lie on  the perimeter of the other, which is not  by itself a clue that they overlap.  Not that it couldn't be done -- I'm thinking maybe the way would be to find all intersections between two Polylines, and check whether any of them do not coincide with a vertex of either Polyline.  But that could fail if there might be intermediate vertices along edges [not simple 4-vertex Polyline rectangles].

 

And again, if arc segments might be involved, that wouldn't be a reliable test -- it would not find, for example, this kind of overlap:

overlap3.png

And if non-rectangular ones might be involved, it would not find, for example, this kind:

overlap4.png

 

So some specifics about the expected possibilities would be useful.  Of course whatever comparison is used would need to be made between every  Polyline and every other  Polyline in the selection, or in the entire drawing if that's what you need.

Kent Cooper, AIA
0 Likes
Message 3 of 4

Anonymous
Not applicable

I've seen a lot of cases and shapes where those two polylines interact to each other. 

What I was thinking, is play with their areas. Something like: " if the two plilynes share at least two points, area A plus area B should be equals as the hypothetical polyline surrounding both and not less. If areaA+areaB is more than hypothetical surrounding polyline, then it means polylines are intersecting. Please let me know if I'm reading this correctly, or if what I am suggesting is senseless. 

 

thanks!

Message 4 of 4

Kent1Cooper
Consultant
Consultant

@Anonymous wrote:

.... the hypothetical polyline surrounding both ….


 

Therein lies the challenge.  I suppose if you can isolate a given pair of Polylines, so that nothing else is visible [put them temporarily on, or Copy them to, a special-purpose Layer, and turn everything else off?] then you could draw a larger Circle or rectangle surrounding them, and use BOUNDARY or BPOLY to achieve a surrounding Polyline, if that sounds worth pursuing.  It would also make a boundary duplicating the Circle, but that can be eliminated based on having the largest area.  If the two Polylines under consideration don't meet at all, but are both closed, BOUNDARY would produce three  results, rather than just two, but that raises another question:  Are they always and only closed  Polylines?  And again, the process would need to be done separately with every pair  of Polylines in the selection.

Kent Cooper, AIA
0 Likes