Detecting Specific Intersecting Lines

Detecting Specific Intersecting Lines

Jgmargarito26
Enthusiast Enthusiast
2,383 Views
12 Replies
Message 1 of 13

Detecting Specific Intersecting Lines

Jgmargarito26
Enthusiast
Enthusiast

So i've been pondering the idea of creating a lisp were it detects if any line intersects or goes over a certain layered lines. For Example If a house goes over a easement line or building line. Maybe it can zoom in or does the red circle were it intersects. like when you are trying to hatch and it cad doesnt let you because the space isn't completely closed. Any help will be gratefully appreciated. 

0 Likes
2,384 Views
12 Replies
Replies (12)
Message 2 of 13

Kent1Cooper
Consultant
Consultant

@Jgmargarito26 wrote:

... it detects if any line intersects or goes over a certain layered lines. .... 


Any  line?  [And presumably any Arc, or Polyline, or ...?]  Should it be restricted to certain Layers of the potential crossing things, in addition to the Layer(s) of the things you don't want crossed?  For instance, you probably don't want to be informed where a driveway edge line, or an overhead wire, or a sewer or water or gas line, or a topographic contour line, crosses a building setback line.

 

Probably the approach to take would be to use every Line or Polyline on your "certain Layer"(s) as a fence in (ssget) selection, and find everything that crosses it/them, which could be pre-limited to only things on certain [other] Layers, as well as to only certain entity types [not Text, for example].  Then (intersectwith) methods could be used to find where those things cross.  HOWEVER, the results of that approach can be distorted if there are Polyline arc segments  involved [which seems likely with property setbacks], or if Arc entities  are involved -- there are lots of threads about detecting things contained within or crossed by Polylines that include arc segments, if you want to Search for an understanding of the complications.

Kent Cooper, AIA
0 Likes
Message 3 of 13

CodeDing
Advisor
Advisor

@Jgmargarito26 ,

 

Well I don't believe you've made it clear what your question is? Are you asking someone to do it for you?

Because that's what it looks like.

 

Here's some references for you, things you'll probably need:

- Inters function.

- Entmake a circle:

(defun Circle (cen rad clr)
  (entmakex (list (cons 0 "CIRCLE") (cons 10 cen)
                  (cons 40 rad) (cons 62 clr)))
);defun

- Entmake a view, if you choose to go this route (a bit more difficult than the "command" "ZOOM" method):

 

Best,

~DD

0 Likes
Message 4 of 13

Jgmargarito26
Enthusiast
Enthusiast

it flew over my head on arc or polylines, yeah this might be to complicated. Would it be easier to do a blanket over the selected items and just pick out what can be intercepted?

0 Likes
Message 5 of 13

Jgmargarito26
Enthusiast
Enthusiast

So what i want to achieve is if some one can help with  a lisp so were it can it detect if the "footprint boundary form" layer line goes over the "building line" & "easment line" laye lines. Kinda when it detects when your trying to hatch something but its not closed. EXAMPLE.png

0 Likes
Message 6 of 13

Kent1Cooper
Consultant
Consultant

But a footprint is allowed to touch  and/or lie along  a setback or easement line, right?  [As it looks like yours might  along the top edge -- can't quite tell from an image.]  It just can't cross over it  into the easement or setback?  That makes it far more complicated -- looking for intersections will find touching and lieing-along just as it will find crossing, and differentiating between the two would be a difficult task, though it may be possible.

Kent Cooper, AIA
0 Likes
Message 7 of 13

dlanorh
Advisor
Advisor
Just my 2 cents worth , but if the line is along then the intersections should be at a vertex and any intersection point should also be a parameter of both lines. If it's not its crossing.

I am not one of the robots you're looking for

0 Likes
Message 8 of 13

Kent1Cooper
Consultant
Consultant

@dlanorh wrote:
Just my 2 cents worth , but if the line is along then the intersections should be at a vertex and any intersection point should also be a parameter of both lines. If it's not its crossing.

 

I assume you mean the intersections should be at a vertex on the building-footprint  Polyline [if that's even what it is], as in the OP's original image if that upper footprint edge does lie along the setback.  The intersections between the two obviously don't  lie at vertices on the setback  [if that's also a Polyline], so you must be talking about the footprint.

 

But checking whether an intersection lies at a vertex on the footprint is not necessarily a valid test:

BdgVsSetback.JPG

Here, with no violation of setbacks, (intersectwith) methods between the setback lines and the building footprint would include point A, but that is not  at a vertex on the building footprint.

 

When Arcs or Polyline arc segments come into the picture, more possibilities that don't fit your description can occur, with intersection points that are not at a vertex on either.

Kent Cooper, AIA
0 Likes
Message 9 of 13

dlanorh
Advisor
Advisor

In 45 yrs of doing this stuff from a set-out perspective, I have never come across a building or a "setback line" that has an arc in it. That's not to say it couldn't happen.

 

Buildings and plots are regular shaped objects. If they're not it increases the build costs if it is a building and it wastes "land" if it is a plot boundary. Developers like to maximise their return.

 

Construct a polyline of the setback lines and find its area. Do the same for the Building. Get your intersection points. If there aren't any its inside. If there are intersections convert both polylines to regions and do a union. If the setback area increases, part of the building lies outside. If it doesn't the building only touches the setback line.

 

Alternatively subtract the setback region from the building region. The resulting shape (if any) will be the part of the building outside the setback.

I am not one of the robots you're looking for

0 Likes
Message 10 of 13

Kent1Cooper
Consultant
Consultant

@dlanorh wrote:

In 45 yrs of doing this stuff from a set-out perspective, I have never come across a building or a "setback line" that has an arc in it. That's not to say it couldn't happen.....


 

Not the building very often, I suppose, but arcs in setback lines are an everyday occurrence on cul-de-sacs and along curved streets.  Just look at some of the examples in the recent thread about fitting the largest possible rectangle into an irregular shape.

Kent Cooper, AIA
0 Likes
Message 11 of 13

dlanorh
Advisor
Advisor

Post a sample drawing (AutoCAD 2010 or earlier) of the above screenshot. It's far easier to work out what is happening and what the layers/lines are.

I am not one of the robots you're looking for

0 Likes
Message 12 of 13

Sea-Haven
Mentor
Mentor

This was done like 40 years ago in Civilcad software draw a house shape place on a lot then pick sides to display offsets re dims, it had options like fix side so house edge matches, slide on brg set offset, so house could be moved, it took no time to work out if possible, if I remember correct arcs worked as well as radial dim.

 

So use a Grread maybe and dims with reactors ?

0 Likes
Message 13 of 13

john.uhden
Mentor
Mentor

I just tested.  vla-intersectwith does not return any intersections of collinear (sp?) lines.

Therefor, if they cross then there is an intersection.

Three observations:

1.  It would be less programming effort if the footprint and the setbacks were both closed polylines so that only one intersectwith test would be required between two objects, but that's really no big deal.

2.  It would be wise to make zero-elevation copies of the objects before testing.

3.  Be sure to use acextendnone (0).

John F. Uhden

0 Likes