Visual LISP, AutoLISP and General Customization
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Overlapping polylines

26 REPLIES 26
Reply
Message 1 of 27
Anonymous
6756 Views, 26 Replies

Overlapping polylines

I work with polylines a lot to maintain Facility Space and I come across polylines that are overlapping. Is it possible to have a routine to find polylines that are overlapping? Sometimes I really have to zoom in pretty close to see if they are overlapping and sometimes it's pretty obvious. It's all very time consuming.

Thanks,
Bobby
26 REPLIES 26
Message 2 of 27
Kent1Cooper
in reply to: Anonymous

This will answer that in many circumstances, but with limitations [see them described there]:

http://discussion.autodesk.com/forums/message.jspa?messageID=6281590&tstart=0

If no one knows of a better way, I can think of a workaround to determine whether there's overlap:

If the above routine says they intersect, get to where you have only the two polylines you want to test showing [either copy them to a test layer and turn all other layers off, or temporarily erase everything except them, or something]. Run Boundary and make a Polyline in one of them. Check the area of the new one against its corresponding old one -- if the new one is smaller, the other Polyline overlaps, and is not merely coincident along some edge.

A routine could certainly be written to handle all of that work for you.

--
Kent Cooper
Kent Cooper, AIA
Message 3 of 27
lpseifert
in reply to: Anonymous

Disregard
~~~Civil 3D 2008~~~
Message 4 of 27
Anonymous
in reply to: Anonymous

Kent,
I will try this Monday when I get back to the office. I'm just thinking out loud here, but I wonder if looking for polylines that meet together (without overlapping) is a better way to do this. I wonder if one way or another would be easier.
Message 5 of 27
stevor
in reply to: Anonymous

1. Disregard what?

2. The overlap data from 'vla-intersectwith must be converted to point coordinatess, and then UCS points, as you may guess.

3. Contiguous pline ends may not be returned by the 'intersecwith function but other methods are available.
S
Message 6 of 27
Anonymous
in reply to: Anonymous

Kent,

I gave it try and it did nothing happened. I'm sure it's something I'm not doing correctly.

I've noticed that VL-XXXX type code is used frequently around here. What exactly is it and where is a good place I can look to learn it?

Thanks
Message 7 of 27
Kent1Cooper
in reply to: Anonymous

If you post the code for your try, maybe someone can figure out what you're not doing correctly.

VL stands for Visual LISP. Its functions can do certain things that "ordinary" Lisp functions can't, or can do some things with a lot less code. There are a number of (vl-) and (vlax-) and (vlr-) functions described in the AutoLisp Reference. The (vla-) functions are harder to figure out how to use, because they don't seem to be documented the same way -- but see the AutoLisp Developer's Guide [Index tab, type in "vla- functions"]. They do not have same kind of examples spelled out, with syntax, etc., as there are for functions listed in the AutoLisp Reference. When I think a (vla-) function is likely to be the easier way to go, I've generally worked from examples on this forum.

--
Kent Cooper
Kent Cooper, AIA
Message 8 of 27
Anonymous
in reply to: Anonymous

If you want a little more on this topic, search this forum for the yesterday
post with the subject "VL VLA functions"


a écrit dans le message de news:
6346079@discussion.autodesk.com...
Kent,

I gave it try and it did nothing happened. I'm sure it's something I'm not
doing correctly.

I've noticed that VL-XXXX type code is used frequently around here. What
exactly is it and where is a good place I can look to learn it?

Thanks
Message 9 of 27
Anonymous
in reply to: Anonymous

On 2/26/2010 3:26 PM, rbevansii wrote:
> I work with polylines a lot to maintain Facility Space and I come across polylines that are overlapping. Is it possible to have a routine to find polylines that are overlapping? Sometimes I really have to zoom in pretty close to see if they are overlapping and sometimes it's pretty obvious. It's all very time consuming.
>
> Thanks,
> Bobby
>

Try the attached.

;| PolylineOverlap.lsp
Determines whether two polylines in the same plane overlap
by turning copies of both into regions and subtracting one
from the other to see if its area changes.

If so, creates a region showing the overlap and zooms in on it.

Works with either heavy or LW polylines, and checks that they are closed
and co-planar. Aborts if either polyline is self-intersecting.
....
Message 10 of 27
Anonymous
in reply to: Anonymous

This would work. I really appreciate this Bill.
Message 11 of 27
Anonymous
in reply to: Anonymous

On 3/1/2010 4:29 PM, rbevansii wrote:
> This would work. I really appreciate this Bill.
>
You're very welcome. Let me know if it gets gummed up anywhere -- there
are so many variables in each person's favorite working environment that
it is hard to anticipate everything that might mess up such a routine.

Now that I think of it, the current layer and the layers that the
polylines are on need to be unlocked or you'll get a "Problem with
polyline" error. Oh, well... I'll get to that in version 2.0.

-Bill
Message 12 of 27
Anonymous
in reply to: Anonymous

Well, here's version 1.01 with the fix for locked layers.

I renamed this to PolylineOverlap.lsp and included the option to run it
with just PLO at the command line.
Message 13 of 27
andrew_k99
in reply to: Anonymous

Have you tried the OVERKILL command? It was created for that purpose.

AJK
Message 14 of 27
Anonymous
in reply to: Anonymous

On 3/2/2010 2:17 PM, Andrew_K99 wrote:
> Have you tried the OVERKILL command? It was created for that purpose.
>
> AJK
>
No, his issue is with two polylines that share several, but not all,
sides in common: the property lines of adjacent real estate parcels.
OVERKILL does nothing to identify or modify that circumstance, and in
any case the OP does not want to delete the segment(s) where they do
coincide, but to identify the region(s) where they do NOT coincide.
Message 15 of 27
Anonymous
in reply to: Anonymous

thanks for the routine, but what if you have open polylines? I have several polylines which I want to make them one, but when I use the pedit it does not do it!! when I want to use some lisps on them, it says that object is self intersecting, how can I spot this?

Message 16 of 27
pbejse
in reply to: Anonymous


@Anonymous wrote:

thanks for the routine, but what if you have open polylines? I have several polylines which I want to make them one, but when I use the pedit it does not do it!! when I want to use some lisps on them, it says that object is self intersecting, how can I spot this?


quick fix

 

Replace 

 

(if ss (setq en2 (ssname ss 0)))

 to

(if ss (progn (setq en2 (ssname ss 0))(vla-put-closed (vlax-ename->vla-object en2) 1)))

for both en1 and en2 

 

These lines will force the pline to cliose

 

HTH

 

 

Message 17 of 27
Anonymous
in reply to: pbejse

Thanks but I don't wanna close it!!!! it is supposed to be an open line

Message 18 of 27
pbejse
in reply to: Anonymous


@Anonymous wrote:

Thanks but I don't wanna close it!!!! it is supposed to be an open line


Will Bpoly work for you?

 

(defun c:Breg (/ el ss i)
  (defun _Entnext (e)
    (if (setq e (entnext e))
      (cons e (_Entnext e))
      )
    )
  (setq el (entlast)
    ss (ssadd)
    )
  (prompt "\nSelect point")
  (command "_.bpoly")
  (while (> (getvar "CMDACTIVE") 0) (command pause))
  (mapcar '(lambda (x) (ssadd x ss)) (_Entnext el))
  (repeat (setq i (sslength ss ))
    (command "_region" (ssname ss (setq i (1- i))) "")
    (entdel (ssname ss i))
    )
  )

 

It creates region for every succesful generated  bounday

 

 

 

Message 19 of 27
pbejse
in reply to: Anonymous


@Anonymous wrote:

Thanks but I don't wanna close it!!!! it is supposed to be an open line


in that case

 

(if ss (progn
             (setq en1 (ssname ss 0))
             (vla-put-closed
		  (setq en1 (vla-copy (vlax-ename->vla-object en1))) 1)
                  (setq en1 (vlax-vla-object->ename en1)))
             )

(setq prevEnt (entlast))
  (command "region" en1 "")
  (entdel en1)

 and

 

(setq prevEnt (entlast))
  (command "region" en2 "")
  (entdel en2)
  (setq newEnt (entlast))

 

for both en1 and en2

Message 20 of 27
blawlor
in reply to: Anonymous

I also work with polylines to measure space inside buildings, and i have come across an issue. an older drawing we have in a very large building seems to have an overlapping space somewhere in the drawing, so the total areas of each room is greater than the total floor boundry area.

 

for example in the attatched dwg, space a is overlapping b, but since it is perfectly overlapped its very hard to notice.

 

does anyone know a command or even just a general trick that could help point out an area like this?

 

thanks!

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

Post to forums  

Autodesk Design & Make Report

”Boost