<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Find and Mark Gaps-Lisp Repair in Visual LISP, AutoLISP and General Customization Forum</title>
    <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/find-and-mark-gaps-lisp-repair/m-p/5950608#M136197</link>
    <description>&lt;P&gt;&lt;SPAN&gt;Henrique,&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;I finnaly got to play around with the code, and it works great. I understand now why its creating gap circles where I wasnt expecting them.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;IMG src="https://forums.autodesk.com/t5/image/serverpage/image-id/206567i42A7DF25363FA974/image-size/original?v=mpbl-1&amp;amp;px=-1" border="0" alt="Capture3.JPG" title="Capture3.JPG" /&gt;&lt;/P&gt;&lt;P&gt;Like this example will produce a gap circle, because of the distance from the green corner to the peach line. However since the Peach line does fall on the green line I would like this to not get marked. If this is possible great, if this is far as we can go, I'll mark your lisp as a solution. It works good enough that I can use it for my purposes. Thanks for all your help.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;-Chris&lt;/P&gt;</description>
    <pubDate>Mon, 14 Dec 2015 17:10:59 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2015-12-14T17:10:59Z</dc:date>
    <item>
      <title>Find and Mark Gaps-Lisp Repair</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/find-and-mark-gaps-lisp-repair/m-p/5934951#M136168</link>
      <description>&lt;P&gt;I'm looking for a lisp that determines if lines/curves/polylines&amp;nbsp;start end end on other lines. Most my drawings should never have a gap, all lines should start at the end of, or on another line/arc/polyline. I found a lisp that does this, but its old&amp;nbsp;(1998)&amp;nbsp;and no longer appears to be working right. The lisp flows fine but its giving me false positives. I was hoping someone could look at the code and repair it or point me to a current lisp that does this.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;A href="http://autocadtips1.com/2011/10/28/autolisp-find-and-mark-gaps/" target="_blank"&gt;http://autocadtips1.com/2011/10/28/autolisp-find-and-mark-gaps/&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;"&lt;SPAN&gt; If you suspect that someone has been drafting and not using osnaps to snap to the endpoints of geometry, this routine will find these gaps and mark them with a red circle. It will even make a layer called “GAP” and put these red circles on that layer for you."&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&lt;IMG src="http://autocadtips.files.wordpress.com/2011/10/gap.gif?w=640" border="0" alt="" title="" /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;;| GAP.LSP locates and marks the ends of arcs, lines, and plines that are close
but not exactly coincident. Gaps are marked by drawing circles on the GAP layer.
You can select part of a drawing to check or press ENTER to check the whole drawing.
These are the distances to control how the gaps are located
Gap Limit = Gaps less than this, but more than fluff are marked
Fluff = Gaps less than this are not marked
Circle Size = Size of circle to mark gaps with
Original routine by McNeel &amp;amp; Associates
-----------------------------------------------------------------------
-----------------------------------------------------------------------
Modified by J. Tippit, SPAUG President 12/29/98
E-mail: cadpres@spaug.org
Web Site: http://www.spaug.org
-----------------------------------------------------------------------
-----------------------------------------------------------------------
Revisions:
12/29/98 Added ability to change Gap Limit, Fluff, &amp;amp; Circle Size
Added CMDECHO, UNDO, OSMODE, &amp;amp; CURLAY
Added a counter for the number of cicles that are drawn
and other misc. prompts
Changed the Gap layer to be RED
-----------------------------------------------------------------------
|;
(defun dxf (x e) (cdr (assoc x e)))
; Removes entities other than line, pline, arc from a selection set
(defun checkss (ss / i)
(setq i (sslength ss))
(while (&amp;gt; i 0)
(setq i (1- i))
(setq ent (entget (ssname ss i)))
(or
(= "LINE" (dxf 0 ent))
(= "POLYLINE" (dxf 0 ent))
(= "ARC" (dxf 0 ent))
(ssdel (ssname ss i) ss)
)
)
(if (&amp;gt; (sslength ss) 0)
ss
)
)
; Returns the endpoints of lines, arcs and pines
(defun endsofent (ent / v e1 e2)
(cond
((= "LINE" (dxf 0 ent))
(list (dxf 10 ent) (dxf 11 ent))
)
((= "ARC" (dxf 0 ent))
(list
(polar (dxf 10 ent) (dxf 50 ent) (dxf 40 ent))
(polar (dxf 10 ent) (dxf 51 ent) (dxf 40 ent))
)
)
((= "POLYLINE" (dxf 0 ent))
(setq v (entget (entnext (dxf -1 ent))))
(setq e1 (dxf 10 v))
(while (/= "SEQEND" (dxf 0 v))
(setq e2 (dxf 10 v))
(setq v (entget (entnext (dxf -1 v))))
)
(list e1 e2)
)
)
)
; gets a selection set of all entities near a point
(defun ssat (pt dist)
(ssget "c"
(list (- (car pt) dist) (- (cadr pt) dist))
(list (+ (car pt) dist) (+ (cadr pt) dist))
)
)
; Looks through a selection set and finds ends near but not at ends
; of other entities
(defun markgaps (ss / i ends)
(setq i (sslength ss))
(while (&amp;gt; i 0)
(setq i (1- i))
(setq ent (entget (ssname ss i)))
(setq ends (endsofent ent))
(princ ".")
; (princ "\n")
; (princ (car ends))
; (princ " -- ")
; (princ (cadr ends))
(endsnear (car ends) gaplimit)
(endsnear (cadr ends) gaplimit)
)
)
(defun circle (pt r)
(command "circle" pt r)
(if (= CNT nil)
(setq CNT 1)
(setq CNT (1+ CNT))
)
)
; Finds the entities near a point and marks their ends if they
; are also near the point
(defun endsnear ( pt dist / ent ends)
(if (setq sse (ssat pt dist))
(progn
(setq j (sslength sse))
(while (&amp;gt; j 0)
(setq j (1- j))
(setq ent (entget (ssname sse j)))
(if
(setq ends (endsofent ent))
(progn
(setq d (distance (car ends) pt))
(if (&amp;lt; 0.0 d gaplimit)
(circle pt circlesize)
)
(setq d (distance (cadr ends) pt))
(if (&amp;lt; 0.0 d gaplimit)
(circle pt circlesize)
)
)
)
)
)
)
)
; Main control function
(defun c:GAP ( / ss )
(setvar "cmdecho" 0)
(command "._undo" "be")
(setq #OSMOD (getvar "osmode"))
(setvar "osmode" 0)
(setq #CURLA (getvar "clayer"))
(setq CNT nil)
(if (= gaplimit nil)
(or
(setq gaplimit (getdist "\nSet Gap Limit &amp;lt;1.0&amp;gt;: "))
(setq gaplimit 1.0)
)
(progn
(setq gaplimit2 gaplimit)
(or
(setq gaplimit (getdist (strcat "\nSet Gap Limit &amp;lt;" (rtos gaplimit 2 1) "&amp;gt;: ")))
(setq gaplimit gaplimit2)
)
)
)
(if (= fluff nil)
(or
(setq fluff (getdist "\nSet Fluff &amp;lt;0.0001&amp;gt;: "))
(setq fluff 0.0001)
)
(progn
(setq fluff2 fluff)
(or
(setq fluff (getdist (strcat "\nSet Fluff &amp;lt;" (rtos fluff 2 4) "&amp;gt;: ")))
(setq fluff fluff2)
)
)
)
(if (= circlesize nil)
(or
(setq circlesize (getdist "\nSet Circle Size &amp;lt;2.0&amp;gt;: "))
(setq circlesize 2.0)
)
(progn
(setq circlesize2 circlesize)
(or
(setq circlesize (getdist (strcat "\nSet Circle Size &amp;lt;" (rtos circlesize 2 1) "&amp;gt;: ")))
(setq circlesize circlesize2)
)
)
)
(command "._layer" "m" "GAP" "c" "1" "GAP" "")
(princ "\nSelect objects or &amp;lt;ENTER&amp;gt; for all: ")
(or
(and
(setq ss (ssget))
(setq ss (checkss ss))
)
(setq ss (ssget "x"
'((-4 . "&amp;lt;OR")
(0 . "LINE")
(0 . "ARC")
(0 . "POLYLINE")
(-4 . "OR&amp;gt;")
)
)
)
)
(princ "\nChecking for Gaps - please wait")
(markgaps ss)
(princ "done!")
(if (/= CNT nil)
(princ (strcat "\n" (itoa CNT) " Circles drawn."))
(princ "\nNo Gaps found.")
)
(setvar "clayer" #CURLA)
(setvar "osmode" #OSMOD)
(command "._undo" "e")
(setvar "cmdecho" 1)
(princ)
)
(prompt "\nLOCATE GAPS is loaded... type GAP to start!")
(princ)&lt;/PRE&gt;&lt;P&gt;Here is a file that I have been testing it on. White lines it gives the correct gaps, but for green lines its giving me false positives.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 03 Dec 2015 18:19:51 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/find-and-mark-gaps-lisp-repair/m-p/5934951#M136168</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2015-12-03T18:19:51Z</dc:date>
    </item>
    <item>
      <title>Re: Find and Mark Gaps-Lisp Repair</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/find-and-mark-gaps-lisp-repair/m-p/5936652#M136169</link>
      <description>&lt;P&gt;Yes, it would be good to revive this lisp.&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 04 Dec 2015 17:54:42 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/find-and-mark-gaps-lisp-repair/m-p/5936652#M136169</guid>
      <dc:creator>АлексЮстасу</dc:creator>
      <dc:date>2015-12-04T17:54:42Z</dc:date>
    </item>
    <item>
      <title>Re: Find and Mark Gaps-Lisp Repair</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/find-and-mark-gaps-lisp-repair/m-p/5936749#M136170</link>
      <description>&lt;P&gt;My version&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;;| GAP.LSP locates and marks the ends of arcs, lines, and plines that are close
but not exactly coincident. Gaps are marked by drawing circles on the GAP layer.
You can select part of a drawing to check or press ENTER to check the whole drawing.
These are the distances to control how the gaps are located
Gap Limit = Gaps less than this, but more than fluff are marked
Fluff = Gaps less than this are not marked
Circle Size = Size of circle to mark gaps with
Original routine by McNeel &amp;amp; Associates
-----------------------------------------------------------------------
-----------------------------------------------------------------------
Modified by J. Tippit, SPAUG President 12/29/98
E-mail: cadpres@spaug.org
Web Site: http://www.spaug.org
-----------------------------------------------------------------------
-----------------------------------------------------------------------
Revisions:
12/29/98 Added ability to change Gap Limit, Fluff, &amp;amp; Circle Size
Added CMDECHO, UNDO, OSMODE, &amp;amp; CURLAY
Added a counter for the number of cicles that are drawn
and other misc. prompts
Changed the Gap layer to be RED

12/04/2015 VVA for dwg.ru
Web site: http://autocadtips1.com/2011/10/28/autolisp-find-and-mark-gaps/
posted http://forum.dwg.ru/showthread.php?p=1479981#post1479981
-----------------------------------------------------------------------
|;
(defun dxf (x e) (cdr (assoc x e)))
; Removes entities other than line, pline, arc from a selection set
(defun checkss (ss / i)
(setq i (sslength ss))
(while (&amp;gt; i 0)
(setq i (1- i))
(setq ent (entget (ssname ss i)))
(or
(= "LINE" (dxf 0 ent))
(= "POLYLINE" (dxf 0 ent))
(= "LWPOLYLINE" (dxf 0 ent))
(= "ARC" (dxf 0 ent))
(ssdel (ssname ss i) ss)
)
)
(if (&amp;gt; (sslength ss) 0)
ss
)
)
; Returns the endpoints of lines, arcs and pines
(defun endsofent (ent / v e1 e2)
(cond
((= "LINE" (dxf 0 ent))
(list (dxf 10 ent) (dxf 11 ent))
)
((= "ARC" (dxf 0 ent))
(list
(polar (dxf 10 ent) (dxf 50 ent) (dxf 40 ent))
(polar (dxf 10 ent) (dxf 51 ent) (dxf 40 ent))
)
)
((= "POLYLINE" (dxf 0 ent))
(setq v (entget (entnext (dxf -1 ent))))
(setq e1 (dxf 10 v))
(while (/= "SEQEND" (dxf 0 v))
(setq e2 (dxf 10 v))
(setq v (entget (entnext (dxf -1 v))))
)
(list e1 e2)
)
((= "LWPOLYLINE" (dxf 0 ent))
(setq e1 (dxf 10 ent))
(setq e2 (dxf 10 (reverse ent)))
(list e1 e2)
)
)
)
; gets a selection set of all entities near a point
(defun ssat (pt dist)
(ssget "_c"
(list (- (car pt) dist) (- (cadr pt) dist))
(list (+ (car pt) dist) (+ (cadr pt) dist))
)
)
; Looks through a selection set and finds ends near but not at ends
; of other entities
(defun markgaps (ss / i ends)
(setq i (sslength ss))
(while (&amp;gt; i 0)
(setq i (1- i))
(setq ent (entget (ssname ss i)))
(setq ends (endsofent ent))
(princ ".")
; (princ "\n")
; (princ (car ends))
; (princ " -- ")
; (princ (cadr ends))
(endsnear (car ends) gaplimit)
(endsnear (cadr ends) gaplimit)
)
)
(defun circle (pt r)
(command "_circle" pt r)
(if (= CNT nil)
(setq CNT 1)
(setq CNT (1+ CNT))
)
)
; Finds the entities near a point and marks their ends if they
; are also near the point
(defun endsnear ( pt dist / ent ends)
(if (setq sse (ssat pt dist))
(progn
(setq j (sslength sse))
(while (&amp;gt; j 0)
(setq j (1- j))
(setq ent (entget (ssname sse j)))
(if
(setq ends (endsofent ent))
(progn
(setq d (distance (car ends) pt))
(if (&amp;lt; 0.0 d gaplimit)
(circle pt circlesize)
)
(setq d (distance (cadr ends) pt))
(if (&amp;lt; 0.0 d gaplimit)
(circle pt circlesize)
)
)
)
)
)
)
)
; Main control function
(defun c:GAP ( / ss )
(setvar "cmdecho" 0)
(command "_.undo" "_begin")
(setq #OSMOD (getvar "osmode"))
(setvar "osmode" 0)
(setq #CURLA (getvar "clayer"))
(setq CNT nil)
(if (= gaplimit nil)
(or
(setq gaplimit (getdist "\nSet Gap Limit &amp;lt;1.0&amp;gt;: "))
(setq gaplimit 1.0)
)
(progn
(setq gaplimit2 gaplimit)
(or
(setq gaplimit (getdist (strcat "\nSet Gap Limit &amp;lt;" (rtos gaplimit 2 1) "&amp;gt;: ")))
(setq gaplimit gaplimit2)
)
)
)
(if (= fluff nil)
(or
(setq fluff (getdist "\nSet Fluff &amp;lt;0.0001&amp;gt;: "))
(setq fluff 0.0001)
)
(progn
(setq fluff2 fluff)
(or
(setq fluff (getdist (strcat "\nSet Fluff &amp;lt;" (rtos fluff 2 4) "&amp;gt;: ")))
(setq fluff fluff2)
)
)
)
(if (= circlesize nil)
(or
(setq circlesize (getdist "\nSet Circle Size &amp;lt;2.0&amp;gt;: "))
(setq circlesize 2.0)
)
(progn
(setq circlesize2 circlesize)
(or
(setq circlesize (getdist (strcat "\nSet Circle Size &amp;lt;" (rtos circlesize 2 1) "&amp;gt;: ")))
(setq circlesize circlesize2)
)
)
)
(command "_.layer" "_m" "GAP" "_c" "1" "GAP" "")
(princ "\nSelect objects or &amp;lt;ENTER&amp;gt; for all: ")
(or
(and
(setq ss (ssget))
(setq ss (checkss ss))
)
(setq ss (ssget "_x"
'((-4 . "&amp;lt;OR")
(0 . "LINE")
(0 . "ARC")
(0 . "POLYLINE")
(-4 . "OR&amp;gt;")
)
)
)
)
(princ "\nChecking for Gaps - please wait")
(markgaps ss)
(princ "done!")
(if (/= CNT nil)
(princ (strcat "\n" (itoa CNT) " Circles drawn."))
(princ "\nNo Gaps found.")
)
(setvar "clayer" #CURLA)
(setvar "osmode" #OSMOD)
(command "_.undo" "_e")
(setvar "cmdecho" 1)
(princ)
)
(prompt "\nLOCATE GAPS is loaded... type GAP to start!")
(princ)&lt;/PRE&gt;</description>
      <pubDate>Fri, 04 Dec 2015 18:52:50 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/find-and-mark-gaps-lisp-repair/m-p/5936749#M136170</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2015-12-04T18:52:50Z</dc:date>
    </item>
    <item>
      <title>Re: Find and Mark Gaps-Lisp Repair</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/find-and-mark-gaps-lisp-repair/m-p/5936938#M136171</link>
      <description>&lt;P&gt;I have a thought -- I'm wondering about floating-point-decimal &lt;EM&gt;precision&lt;/EM&gt; issues, which can sometimes cause issues such as this.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;This part in the (endsnear) function could be the culprit:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp; (setq d (distance (car ends) pt))&lt;BR /&gt;&amp;nbsp; (if (&amp;lt; 0.0 d gaplimit)&lt;BR /&gt;&amp;nbsp; &amp;nbsp; (circle pt circlesize)&lt;BR /&gt;&amp;nbsp; )&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Because of the way the routine gets object endpoints, with calculations using pieces extracted from entity data lists, it could be that even if an object's end &lt;EM&gt;does&lt;/EM&gt; lie exactly &lt;EM&gt;on&lt;/EM&gt; some other object, the result of those accumulated calculations, compounded by being used in a (distance) function, could come out to, for example, 0.0000000000038104, rather than &lt;EM&gt;exactly&lt;/EM&gt; 0.0. &amp;nbsp;The (&amp;lt;) function &lt;EM&gt;can tell the difference&lt;/EM&gt;, so it will &lt;EM&gt;not&lt;/EM&gt; consider that endpoint to fall precisely on the other object, and therefore will mark it.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Since the result of a (distance) function is never negative, you could have it check whether it's not-right-on &lt;EM&gt;within some tight tolerance&lt;/EM&gt;, rather than whether the calculated distance is greater than&amp;nbsp;0. &amp;nbsp;The (equal) function has a fuzz-factor option. &amp;nbsp;Try [I &lt;EM&gt;haven't&lt;/EM&gt; gone through the exercise] something like this, instead of the (if) function above, so that if it's right on &lt;EM&gt;to within 10-to-the-minus-8&lt;/EM&gt; [change that number to whatever precision you need], even if the calculated distance isn't precisely zero, it won't mark it:&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp; (if&lt;/P&gt;
&lt;P&gt;&amp;nbsp; &amp;nbsp; (and&lt;/P&gt;
&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; (not (equal d 0.0 1e-8))&lt;/P&gt;
&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; (&amp;lt; d gaplimit)&lt;/P&gt;
&lt;P&gt;&amp;nbsp; &amp;nbsp; ); and&lt;/P&gt;
&lt;P&gt;&amp;nbsp; &amp;nbsp; (circle pt circlesize)&lt;BR /&gt;&amp;nbsp; ); if&lt;/P&gt;
&lt;P&gt;&amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 04 Dec 2015 20:55:08 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/find-and-mark-gaps-lisp-repair/m-p/5936938#M136171</guid>
      <dc:creator>Kent1Cooper</dc:creator>
      <dc:date>2015-12-04T20:55:08Z</dc:date>
    </item>
    <item>
      <title>Re: Find and Mark Gaps-Lisp Repair</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/find-and-mark-gaps-lisp-repair/m-p/5937103#M136172</link>
      <description>&lt;P&gt;&lt;SPAN&gt;&lt;A href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/380804" target="_self"&gt;v.azarko&lt;/A&gt;&amp;nbsp;-&amp;nbsp;&lt;/SPAN&gt;Still gives me the same false positives that I was getting before.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Kent &amp;nbsp;- Your talking above my head, but from what little I understand that sounds legiitamte. No idea where to add your line of code. I know many off the false positives I get our two lines that look like they are connected, read the same start and end points, and I can join into a poyline. So some kind of mathmatical error on how it determines if two end point are the same makes sense to me.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 04 Dec 2015 23:03:39 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/find-and-mark-gaps-lisp-repair/m-p/5937103#M136172</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2015-12-04T23:03:39Z</dc:date>
    </item>
    <item>
      <title>Re: Find and Mark Gaps-Lisp Repair</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/find-and-mark-gaps-lisp-repair/m-p/5937225#M136173</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;@Anonymous wrote:&lt;BR /&gt;
&lt;P&gt;.... No idea &lt;FONT color="#ff0000"&gt;where to add&lt;/FONT&gt; your line of code. ....&amp;nbsp;&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;To pull the instructions in Post 4 out of the surrounding clutter:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;....&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#3366ff"&gt;&amp;nbsp; (if (&amp;lt; 0.0 d gaplimit)&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT color="#3366ff"&gt;&amp;nbsp; &amp;nbsp; (circle pt circlesize)&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT color="#3366ff"&gt;&amp;nbsp; )&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;.... &amp;nbsp;Try&amp;nbsp;... this, &lt;FONT color="#ff0000"&gt;instead of &lt;FONT color="#3366ff"&gt;the (if) function above&lt;/FONT&gt;&lt;/FONT&gt;... :&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp; (if&lt;/P&gt;
&lt;P&gt;&amp;nbsp; &amp;nbsp; (and&lt;/P&gt;
&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; (not (equal d 0.0 1e-8))&lt;/P&gt;
&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; (&amp;lt; d gaplimit)&lt;/P&gt;
&lt;P&gt;&amp;nbsp; &amp;nbsp; ); and&lt;/P&gt;
&lt;P&gt;&amp;nbsp; &amp;nbsp; (circle pt circlesize)&lt;BR /&gt;&amp;nbsp; ); if&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 05 Dec 2015 03:08:34 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/find-and-mark-gaps-lisp-repair/m-p/5937225#M136173</guid>
      <dc:creator>Kent1Cooper</dc:creator>
      <dc:date>2015-12-05T03:08:34Z</dc:date>
    </item>
    <item>
      <title>Re: Find and Mark Gaps-Lisp Repair</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/find-and-mark-gaps-lisp-repair/m-p/5937690#M136174</link>
      <description>&lt;P&gt;In my 2016 for &lt;EM&gt;GAP-Test.dwg &lt;/EM&gt;of the first message:&lt;EM&gt;&lt;BR /&gt;&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;- 123 circles-markers,&lt;/P&gt;&lt;P&gt;- 2 true gaps,&lt;/P&gt;&lt;P&gt;- 1 gap - debatable,&lt;/P&gt;&lt;P&gt;- other - false. 8 - line, arc &amp;lt; limit. For all other I do not find explanations.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;All parameters by default, diameter of &lt;SPAN&gt;&lt;SPAN&gt;circles&lt;/SPAN&gt;&lt;/SPAN&gt; - 0.4.&lt;/P&gt;</description>
      <pubDate>Sat, 05 Dec 2015 18:57:02 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/find-and-mark-gaps-lisp-repair/m-p/5937690#M136174</guid>
      <dc:creator>АлексЮстасу</dc:creator>
      <dc:date>2015-12-05T18:57:02Z</dc:date>
    </item>
    <item>
      <title>Re: Find and Mark Gaps-Lisp Repair</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/find-and-mark-gaps-lisp-repair/m-p/5937761#M136175</link>
      <description>&lt;P&gt;Hi Chris,&lt;/P&gt;
&lt;P&gt;try this &lt;SPAN class="hps"&gt;quick&lt;/SPAN&gt; &lt;SPAN class="hps"&gt;and dirty 'demo'&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;(vl-load-com)
(defun c:demo (/ get_glob_real mk_circle hnd i lst obj ori pt ss ss1 ss2)

   (defun get_glob_real (var msg mod prec def / tmpH)
      (if (or (not var) (/= (type var) 'REAL))
         (setq var def)
      )
      (initget 6)
      (setq tmpH (getreal (strcat "\n" msg " &amp;lt;" (rtos var mod prec) "&amp;gt;: ")))
      (if (/= tmpH nil)
         (setq var tmpH)
      )
      var
   )

   (defun mk_circle (pt dia)
      (entmake
         (list
            '(0 . "CIRCLE")
            '(8 . "GAP")
            (cons 10 pt)
            (cons 40 (/ dia 2.0))
            '(62 . 1)
         )
      )
   )

   (if (and (setq *_max_fuzz (get_glob_real *_max_fuzz "Enter Maximum Gap" 2 3 0.05))
            (setq *_min_fuzz (get_glob_real *_min_fuzz "Enter Minimum Gap" 2 3 0.001))
            (setq *_dia (get_glob_real *_dia "Enter Circle Size" 2 2 0.50))
            (setq ss (ssget '((0 . "ARC,LINE,LWPOLYLINE"))))
       )
      (progn

         (repeat (setq i (sslength ss))
            (setq hnd (ssname ss (setq i (1- i)))
                  lst (cons (vlax-curve-getstartpoint hnd) lst)
                  lst (cons (vlax-curve-getendpoint hnd) lst)
            )
         )
         (while lst
            (setq pt  (car lst)
                  lst (cdr lst)
            )
            (if (not (vl-some '(lambda (p) (equal p pt *_min_fuzz)) lst))
               (if (setq ss1 (ssget "_C"
                                    (list (- (car pt) *_max_fuzz) (- (cadr pt) *_max_fuzz))
                                    (list (+ (car pt) *_max_fuzz) (+ (cadr pt) *_max_fuzz))
                             )
                   )
                  (if (setq ss2 (ssget "_C" pt pt '((0 . "ARC,LINE,LWPOLYLINE"))))
                     (progn
                        (setq ori (ssname ss2 0))
                        (repeat (setq i (sslength ss2))
                           (setq hnd (ssname ss2 (setq i (1- i)))
                                 obj (vlax-ename-&amp;gt;vla-object hnd)
                           )
                           (if (and (not (eq ori hnd))
                                    (not (vlax-curve-getParamAtPoint obj pt))
                               )
                              (mk_circle pt *_dia)
                           )
                        )
                     )
                  )
               )
            )
            (setq lst (vl-remove-if '(lambda (p) (equal p pt *_min_fuzz)) lst))
         )
      )
   )
   (princ)
)&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN class="hps"&gt;Hope this helps, &lt;BR /&gt;Henrique&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Sat, 05 Dec 2015 22:17:34 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/find-and-mark-gaps-lisp-repair/m-p/5937761#M136175</guid>
      <dc:creator>hmsilva</dc:creator>
      <dc:date>2015-12-05T22:17:34Z</dc:date>
    </item>
    <item>
      <title>Re: Find and Mark Gaps-Lisp Repair</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/find-and-mark-gaps-lisp-repair/m-p/5937831#M136176</link>
      <description>&lt;P&gt;For &lt;EM&gt;GAP-Test.dwg&lt;/EM&gt; became excellent.&lt;BR /&gt;I did &lt;EM&gt;GAP-Test_polyline.dwg&lt;/EM&gt; with polylines.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Results for some reason depend on the zoom. What less zoom, the anymore finds breaks.&lt;BR /&gt;At a maximal zoom can find nothing.&lt;BR /&gt;A right upper case finds never.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;On my opinion, the search of gaps is needed in units of drawing.&lt;/P&gt;</description>
      <pubDate>Sun, 06 Dec 2015 02:15:38 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/find-and-mark-gaps-lisp-repair/m-p/5937831#M136176</guid>
      <dc:creator>АлексЮстасу</dc:creator>
      <dc:date>2015-12-06T02:15:38Z</dc:date>
    </item>
    <item>
      <title>Re: Find and Mark Gaps-Lisp Repair</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/find-and-mark-gaps-lisp-repair/m-p/5938126#M136177</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/568336"&gt;@АлексЮстасу&lt;/a&gt; wrote:&lt;BR /&gt;
&lt;P&gt;For &lt;EM&gt;GAP-Test.dwg&lt;/EM&gt; became excellent.&lt;BR /&gt;I did &lt;EM&gt;GAP-Test_polyline.dwg&lt;/EM&gt; with polylines.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Results for some reason depend on the zoom. What less zoom, the anymore finds breaks.&lt;BR /&gt;At a maximal zoom can find nothing.&lt;BR /&gt;A right upper case finds never.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;On my opinion, the search of gaps is needed in units of drawing.&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;Hi Alexander, &lt;/P&gt;
&lt;P&gt;try this &lt;SPAN class="hps alt-edited"&gt;quickly&lt;/SPAN&gt; &lt;SPAN class="hps alt-edited"&gt;revised &lt;EM&gt;'demo'&lt;/EM&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;(vl-load-com)
(defun c:demo (/ get_glob_real mk_circle hnd i lst obj ori pt pt1 pt2 ss ss1 ss2)

   (defun get_glob_real (var msg mod prec def / tmpH)
      (if (or (not var) (/= (type var) 'REAL))
         (setq var def)
      )
      (initget 6)
      (setq tmpH (getreal (strcat "\n" msg " &amp;lt;" (rtos var mod prec) "&amp;gt;: ")))
      (if (/= tmpH nil)
         (setq var tmpH)
      )
      var
   )

   (defun mk_circle (pt dia)
      (entmake
         (list
            '(0 . "CIRCLE")
            '(8 . "GAP")
            (cons 10 pt)
            (cons 40 (/ dia 2.0))
            '(62 . 1)
         )
      )
   )

   (if (and (setq *_max_fuzz (get_glob_real *_max_fuzz "Enter Maximum Gap" 2 3 0.05))
            (setq *_min_fuzz (get_glob_real *_min_fuzz "Enter Minimum Gap" 2 3 0.001))
            (setq *_dia (get_glob_real *_dia "Enter Circle Size" 2 2 0.50))
            (setq ss (ssget '((0 . "ARC,LINE,LWPOLYLINE"))))
       )
      (progn
         (vl-cmdf "_.-view" "_S" "temp_h" "_.ucs" "_W")
         (repeat (setq i (sslength ss))
            (setq hnd (ssname ss (setq i (1- i)))
                  lst (cons (vlax-curve-getstartpoint hnd) lst)
                  lst (cons (vlax-curve-getendpoint hnd) lst)
            )
         )
         (while lst
            (setq pt  (car lst)
                  lst (cdr lst)
            )
            (if (not (vl-some '(lambda (p) (equal p pt *_min_fuzz)) lst))
               (if (and (vl-cmdf "_.zoom"
                                 (setq pt1 (list (- (car pt) *_max_fuzz) (- (cadr pt) *_max_fuzz)))
                                 (setq pt2 (list (+ (car pt) *_max_fuzz) (+ (cadr pt) *_max_fuzz)))
                        )
                        (setq ss1 (ssget "_C" pt1 pt2))
                   )
                  (if (setq ss2 (ssget "_C" pt pt '((0 . "ARC,LINE,LWPOLYLINE"))))
                     (progn
                        (setq ori (ssname ss2 0))
                        (repeat (setq i (sslength ss1))
                           (setq hnd (ssname ss1 (setq i (1- i)))
                                 obj (vlax-ename-&amp;gt;vla-object hnd)
                           )
                           (if (ssmemb hnd ss)
                              (if (and (not (eq ori hnd))
                                       (not (vlax-curve-getParamAtPoint obj pt))
                                  )
                                 (mk_circle pt *_dia)
                                 (if (and (eq ori hnd)
                                          (= (vla-get-objectname obj) "AcDbPolyline")
                                          (= (vla-get-closed obj) :vlax-false)
                                          (&amp;lt;= *_min_fuzz (distance (vlax-curve-getStartPoint obj) (vlax-curve-getEndPoint obj)) *_max_fuzz)
                                     )
                                    (mk_circle pt *_dia)
                                 )
                              )
                           )
                        )
                     )
                  )
               )
            )
            (setq lst (vl-remove-if '(lambda (p) (equal p pt *_min_fuzz)) lst))
         )
         (vl-cmdf "_.-view" "_R" "temp_h" "_.-view" "_D" "temp_h")
      )
   )
   (princ)
)&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN class="hps alt-edited"&gt;Hope this helps, &lt;BR /&gt;Henrique&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Sun, 06 Dec 2015 15:56:01 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/find-and-mark-gaps-lisp-repair/m-p/5938126#M136177</guid>
      <dc:creator>hmsilva</dc:creator>
      <dc:date>2015-12-06T15:56:01Z</dc:date>
    </item>
    <item>
      <title>Re: Find and Mark Gaps-Lisp Repair</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/find-and-mark-gaps-lisp-repair/m-p/5938835#M136178</link>
      <description>&lt;P&gt;Hi, Henrique,&lt;BR /&gt;&lt;BR /&gt;thank you, now better find gaps.&lt;BR /&gt;&lt;BR /&gt;Tried to add to the lines&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;(setq ss (ssget '((0 . "ARC,LINE,LWPOLYLINE"))))&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;(if (setq ss2 (ssget "_C" pt pt '((0 . "ARC,LINE,LWPOLYLINE"))))&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;"3DPOLYLINE, SPLINE". To my large surprise the program began to process SPLINE.&lt;BR /&gt;But 3DPOLYLINE did not begin to process. I know that my actions are funny - I do not quite know lisp.&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;Now the program works notedly slower. It from the actions of&amp;nbsp; .-view, _.ucs,&amp;nbsp; .zoom?&lt;/P&gt;</description>
      <pubDate>Mon, 07 Dec 2015 10:21:52 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/find-and-mark-gaps-lisp-repair/m-p/5938835#M136178</guid>
      <dc:creator>АлексЮстасу</dc:creator>
      <dc:date>2015-12-07T10:21:52Z</dc:date>
    </item>
    <item>
      <title>Re: Find and Mark Gaps-Lisp Repair</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/find-and-mark-gaps-lisp-repair/m-p/5939004#M136179</link>
      <description>&lt;P&gt;Try it&lt;/P&gt;&lt;PRE&gt;(setq ss (ssget '((0 . "ARC,*LINE"))))
&amp;nbsp;
(if (setq ss2 (ssget "_C" pt pt '((0 . "ARC,*LINE"))))&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 07 Dec 2015 12:25:40 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/find-and-mark-gaps-lisp-repair/m-p/5939004#M136179</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2015-12-07T12:25:40Z</dc:date>
    </item>
    <item>
      <title>Re: Find and Mark Gaps-Lisp Repair</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/find-and-mark-gaps-lisp-repair/m-p/5939030#M136180</link>
      <description>&lt;P&gt;Next version&lt;/P&gt;&lt;PRE&gt;;| GAP.LSP locates and marks the ends of arcs, lines, and plines that are close&lt;BR /&gt;but not exactly coincident. Gaps are marked by drawing circles on the GAP layer.&lt;BR /&gt;You can select part of a drawing to check or press ENTER to check the whole drawing.&lt;BR /&gt;These are the distances to control how the gaps are located&lt;BR /&gt;Gap Limit = Gaps less than this, but more than fluff are marked&lt;BR /&gt;Fluff = Gaps less than this are not marked&lt;BR /&gt;Circle Size = Size of circle to mark gaps with&lt;BR /&gt;Original routine by McNeel &amp;amp; Associates&lt;BR /&gt;-----------------------------------------------------------------------&lt;BR /&gt;-----------------------------------------------------------------------&lt;BR /&gt;Modified by J. Tippit, SPAUG President 12/29/98&lt;BR /&gt;E-mail: cadpres@spaug.org&lt;BR /&gt;Web Site: http://www.spaug.org&lt;BR /&gt;-----------------------------------------------------------------------&lt;BR /&gt;-----------------------------------------------------------------------&lt;BR /&gt;Revisions:&lt;BR /&gt;12/29/98 Added ability to change Gap Limit, Fluff, &amp;amp; Circle Size&lt;BR /&gt;Added CMDECHO, UNDO, OSMODE, &amp;amp; CURLAY&lt;BR /&gt;Added a counter for the number of cicles that are drawn&lt;BR /&gt;and other misc. prompts&lt;BR /&gt;Changed the Gap layer to be RED&lt;BR /&gt;&lt;BR /&gt;12/04/2015 VVA for dwg.ru&lt;BR /&gt;Web site: http://autocadtips1.com/2011/10/28/autolisp-find-and-mark-gaps/&lt;BR /&gt;posted http://forum.dwg.ru/showthread.php?p=1479981#post1479981&lt;BR /&gt;-----------------------------------------------------------------------&lt;BR /&gt;|;&lt;BR /&gt;(vl-load-com)&lt;BR /&gt;(defun dxf (x e) (cdr (assoc x e)))&lt;BR /&gt; ;_ Removes entities other than line, pline, arc from a selection set&lt;BR /&gt;(defun checkss (ss / i)&lt;BR /&gt; (setq i (sslength ss))&lt;BR /&gt; (while (&amp;gt; i 0)&lt;BR /&gt; (setq i (1- i))&lt;BR /&gt; (setq ent (entget (ssname ss i)))&lt;BR /&gt; (or&lt;BR /&gt; (= "LINE" (dxf 0 ent))&lt;BR /&gt; (= "POLYLINE" (dxf 0 ent))&lt;BR /&gt; (= "LWPOLYLINE" (dxf 0 ent))&lt;BR /&gt; (= "SPLINE" (dxf 0 ent))&lt;BR /&gt; (= "ARC" (dxf 0 ent))&lt;BR /&gt; (ssdel (ssname ss i) ss)&lt;BR /&gt; ) ;_ end of or&lt;BR /&gt; ) ;_ end of while&lt;BR /&gt; (if (&amp;gt; (sslength ss) 0)&lt;BR /&gt; ss&lt;BR /&gt; ) ;_ end of if&lt;BR /&gt;) ;_ end of defun&lt;BR /&gt; ;_ Returns the endpoints of lines, arcs and pines&lt;BR /&gt;(defun endsofent (ent / v e1 e2)&lt;BR /&gt; (cond&lt;BR /&gt; ((= "LINE" (dxf 0 ent))&lt;BR /&gt; (list (dxf 10 ent) (dxf 11 ent))&lt;BR /&gt; )&lt;BR /&gt; ((= "ARC" (dxf 0 ent))&lt;BR /&gt; (list&lt;BR /&gt; (polar (dxf 10 ent) (dxf 50 ent) (dxf 40 ent))&lt;BR /&gt; (polar (dxf 10 ent) (dxf 51 ent) (dxf 40 ent))&lt;BR /&gt; ) ;_ end of list&lt;BR /&gt; )&lt;BR /&gt; ((= "POLYLINE" (dxf 0 ent))&lt;BR /&gt; (setq v (entget (entnext (dxf -1 ent))))&lt;BR /&gt; (setq e1 (dxf 10 v))&lt;BR /&gt; (while (/= "SEQEND" (dxf 0 v))&lt;BR /&gt; (setq e2 (dxf 10 v))&lt;BR /&gt; (setq v (entget (entnext (dxf -1 v))))&lt;BR /&gt; ) ;_ end of while&lt;BR /&gt; (list e1 e2)&lt;BR /&gt; )&lt;BR /&gt; ((= "LWPOLYLINE" (dxf 0 ent))&lt;BR /&gt; (setq e1 (dxf 10 ent))&lt;BR /&gt; (setq e2 (dxf 10 (reverse ent)))&lt;BR /&gt; (list e1 e2)&lt;BR /&gt; )&lt;BR /&gt; ((= "SPLINE" (dxf 0 ent))&lt;BR /&gt; (list&lt;BR /&gt; (vlax-curve-getstartpoint&lt;BR /&gt; (vlax-ename-&amp;gt;vla-object (dxf -1 ent))&lt;BR /&gt; ) ;_ end of vlax-curve-getStartPoint&lt;BR /&gt; (vlax-curve-getendpoint&lt;BR /&gt; (vlax-ename-&amp;gt;vla-object (dxf -1 ent))&lt;BR /&gt; ) ;_ end of vlax-curve-getEndPoint&lt;BR /&gt; ) ;_ end of list&lt;BR /&gt; )&lt;BR /&gt; ) ;_ end of cond&lt;BR /&gt;) ;_ end of defun&lt;BR /&gt; ;_ gets a selection set of all entities near a point&lt;BR /&gt;(defun ssat (pt dist)&lt;BR /&gt; (ssget "_c"&lt;BR /&gt; (list (- (car pt) dist) (- (cadr pt) dist))&lt;BR /&gt; (list (+ (car pt) dist) (+ (cadr pt) dist))&lt;BR /&gt; ) ;_ end of ssget&lt;BR /&gt;) ;_ end of defun&lt;BR /&gt; ;_ Looks through a selection set and finds ends near but not at ends&lt;BR /&gt; ;_ of other entities&lt;BR /&gt;(defun markgaps (ss / i ends)&lt;BR /&gt; (setq i (sslength ss))&lt;BR /&gt; (while (&amp;gt; i 0)&lt;BR /&gt; (setq i (1- i))&lt;BR /&gt; (setq ent (entget (ssname ss i)))&lt;BR /&gt; (setq ends (endsofent ent))&lt;BR /&gt; (princ ".")&lt;BR /&gt; ;_ (princ "\n")&lt;BR /&gt; ;_ (princ (car ends))&lt;BR /&gt; ;_ (princ " -- ")&lt;BR /&gt; ;_ (princ (cadr ends))&lt;BR /&gt; (endsnear (car ends) gaplimit)&lt;BR /&gt; (endsnear (cadr ends) gaplimit)&lt;BR /&gt; ) ;_ end of while&lt;BR /&gt;) ;_ end of defun&lt;BR /&gt;(defun circle (pt r)&lt;BR /&gt; (command "_circle" "_none" pt r)&lt;BR /&gt; (if (= CNT nil)&lt;BR /&gt; (setq CNT 1)&lt;BR /&gt; (setq CNT (1+ CNT))&lt;BR /&gt; ) ;_ end of if&lt;BR /&gt;) ;_ end of defun&lt;BR /&gt; ;_ Finds the entities near a point and marks their ends if they&lt;BR /&gt; ;_ are also near the point&lt;BR /&gt;(defun endsnear (pt dist / ent ends)&lt;BR /&gt; (if (setq sse (ssat pt dist))&lt;BR /&gt; (progn&lt;BR /&gt; (setq j (sslength sse))&lt;BR /&gt; (while (&amp;gt; j 0)&lt;BR /&gt; (setq j (1- j))&lt;BR /&gt; (setq ent (entget (ssname sse j)))&lt;BR /&gt; (if&lt;BR /&gt; (setq ends (endsofent ent))&lt;BR /&gt; (progn&lt;BR /&gt; (setq d (distance (car ends) pt))&lt;BR /&gt;&lt;BR /&gt; (if&lt;BR /&gt; (and&lt;BR /&gt; (not (equal d 0.0 1e-8))&lt;BR /&gt; (&amp;lt; d gaplimit)&lt;BR /&gt; ) ;_ and&lt;BR /&gt; (circle pt circlesize)&lt;BR /&gt; ) ;_ if&lt;BR /&gt;&lt;BR /&gt; (setq d (distance (cadr ends) pt))&lt;BR /&gt; ) ;_ end of progn&lt;BR /&gt; ) ;_ end of if&lt;BR /&gt; ) ;_ end of while&lt;BR /&gt; ) ;_ end of progn&lt;BR /&gt; ) ;_ end of if&lt;BR /&gt;) ;_ end of defun&lt;BR /&gt; ;_ Main control function&lt;BR /&gt;(defun c:GAP (/ ss)&lt;BR /&gt; (setvar "cmdecho" 0)&lt;BR /&gt; (command "_.undo" "_begin")&lt;BR /&gt; (setq #OSMOD (getvar "osmode"))&lt;BR /&gt; (setvar "osmode" 0)&lt;BR /&gt; (setq #CURLA (getvar "clayer"))&lt;BR /&gt; (setq CNT nil)&lt;BR /&gt; (if (= gaplimit nil)&lt;BR /&gt; (or&lt;BR /&gt; (setq gaplimit (getdist "\nSet Gap Limit &amp;lt;1.0&amp;gt;: "))&lt;BR /&gt; (setq gaplimit 1.0)&lt;BR /&gt; ) ;_ end of or&lt;BR /&gt; (progn&lt;BR /&gt; (setq gaplimit2 gaplimit)&lt;BR /&gt; (or&lt;BR /&gt; (setq gaplimit (getdist (strcat "\nSet Gap Limit &amp;lt;"&lt;BR /&gt; (rtos gaplimit 2 1)&lt;BR /&gt; "&amp;gt;: "&lt;BR /&gt; ) ;_ end of strcat&lt;BR /&gt; ) ;_ end of getdist&lt;BR /&gt; ) ;_ end of setq&lt;BR /&gt; (setq gaplimit gaplimit2)&lt;BR /&gt; ) ;_ end of or&lt;BR /&gt; ) ;_ end of progn&lt;BR /&gt; ) ;_ end of if&lt;BR /&gt; (if (= fluff nil)&lt;BR /&gt; (or&lt;BR /&gt; (setq fluff (getdist "\nSet Fluff &amp;lt;0.0001&amp;gt;: "))&lt;BR /&gt; (setq fluff 0.0001)&lt;BR /&gt; ) ;_ end of or&lt;BR /&gt; (progn&lt;BR /&gt; (setq fluff2 fluff)&lt;BR /&gt; (or&lt;BR /&gt; (setq fluff&lt;BR /&gt; (getdist (strcat "\nSet Fluff &amp;lt;" (rtos fluff 2 4) "&amp;gt;: ")&lt;BR /&gt; ) ;_ end of getdist&lt;BR /&gt; ) ;_ end of setq&lt;BR /&gt; (setq fluff fluff2)&lt;BR /&gt; ) ;_ end of or&lt;BR /&gt; ) ;_ end of progn&lt;BR /&gt; ) ;_ end of if&lt;BR /&gt; (if (= circlesize nil)&lt;BR /&gt; (or&lt;BR /&gt; (setq circlesize (getdist "\nSet Circle Size &amp;lt;2.0&amp;gt;: "))&lt;BR /&gt; (setq circlesize 2.0)&lt;BR /&gt; ) ;_ end of or&lt;BR /&gt; (progn&lt;BR /&gt; (setq circlesize2 circlesize)&lt;BR /&gt; (or&lt;BR /&gt; (setq circlesize&lt;BR /&gt; (getdist (strcat "\nSet Circle Size &amp;lt;"&lt;BR /&gt; (rtos circlesize 2 1)&lt;BR /&gt; "&amp;gt;: "&lt;BR /&gt; ) ;_ end of strcat&lt;BR /&gt; ) ;_ end of getdist&lt;BR /&gt; ) ;_ end of setq&lt;BR /&gt; (setq circlesize circlesize2)&lt;BR /&gt; ) ;_ end of or&lt;BR /&gt; ) ;_ end of progn&lt;BR /&gt; ) ;_ end of if&lt;BR /&gt; (command "_.layer" "_m" "GAP" "_c" "1" "GAP" "")&lt;BR /&gt; ;_ (princ "\nSelect objects or &amp;lt;ENTER&amp;gt; for all: ")&lt;BR /&gt; (or&lt;BR /&gt; (and&lt;BR /&gt; (setq ss (ssget "_I"))&lt;BR /&gt; (setq ss (checkss ss))&lt;BR /&gt; ) ;_ end of and&lt;BR /&gt; (progn&lt;BR /&gt; (SSSETFIRST nil nil)&lt;BR /&gt; (setq ss (ssget &lt;BR /&gt; '((-4 . "&amp;lt;OR")&lt;BR /&gt; (0 . "LINE")&lt;BR /&gt; (0 . "ARC")&lt;BR /&gt; (0 . "POLYLINE")&lt;BR /&gt; (0 . "LWPOLYLINE")&lt;BR /&gt; (0 . "SPLINE")&lt;BR /&gt; (-4 . "OR&amp;gt;")&lt;BR /&gt; )&lt;BR /&gt; ) ;_ end of ssget&lt;BR /&gt; ) ;_ end of setq&lt;BR /&gt; )&lt;BR /&gt; ) ;_ end of or&lt;BR /&gt; (princ "\nChecking for Gaps - please wait")&lt;BR /&gt; (if (and ss (eq (type ss) 'PICKSET) (&amp;gt; (sslength ss) 0))&lt;BR /&gt; (markgaps ss)&lt;BR /&gt; ) ;_ end of if&lt;BR /&gt; (princ "done!")&lt;BR /&gt; (if (/= CNT nil)&lt;BR /&gt; (princ (strcat "\n" (itoa CNT) " Circles drawn."))&lt;BR /&gt; (princ "\nNo Gaps found.")&lt;BR /&gt; ) ;_ end of if&lt;BR /&gt; (setvar "clayer" #CURLA)&lt;BR /&gt; (setvar "osmode" #OSMOD)&lt;BR /&gt; (command "_.undo" "_e")&lt;BR /&gt; (setvar "cmdecho" 1)&lt;BR /&gt; (princ)&lt;BR /&gt;) ;_ end of defun&lt;BR /&gt;(prompt "\nLOCATE GAPS is loaded... type GAP to start!")&lt;BR /&gt;(princ)&lt;BR /&gt;&lt;BR /&gt;&lt;/PRE&gt;&lt;P&gt;Tested on&amp;nbsp;&lt;A href="https://forums.autodesk.com/autodesk/attachments/autodesk/130/337274/1/GAP-Test_2.dwg" target="_self"&gt;GAP-Test_2.dwg&lt;/A&gt;&amp;nbsp;with next&amp;nbsp;settings&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;Command: gap
Set Gap Limit &amp;lt;0.1&amp;gt;:
Set Fluff &amp;lt;0.0001&amp;gt;:
Set Circle Size &amp;lt;2.0&amp;gt;:&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 07 Dec 2015 13:01:53 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/find-and-mark-gaps-lisp-repair/m-p/5939030#M136180</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2015-12-07T13:01:53Z</dc:date>
    </item>
    <item>
      <title>Re: Find and Mark Gaps-Lisp Repair</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/find-and-mark-gaps-lisp-repair/m-p/5939080#M136181</link>
      <description>&lt;P&gt;Edit previous post&lt;/P&gt;</description>
      <pubDate>Mon, 07 Dec 2015 13:02:43 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/find-and-mark-gaps-lisp-repair/m-p/5939080#M136181</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2015-12-07T13:02:43Z</dc:date>
    </item>
    <item>
      <title>Re: Find and Mark Gaps-Lisp Repair</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/find-and-mark-gaps-lisp-repair/m-p/5939286#M136182</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/568336"&gt;@АлексЮстасу&lt;/a&gt; wrote:&lt;BR /&gt;
&lt;P&gt;Hi, Henrique,&lt;BR /&gt;&lt;BR /&gt;thank you, now better find gaps.&lt;BR /&gt;&lt;BR /&gt;Tried to add to the lines&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;(setq ss (ssget '((0 . "ARC,LINE,LWPOLYLINE"))))&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;(if (setq ss2 (ssget "_C" pt pt '((0 . "ARC,LINE,LWPOLYLINE"))))&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;"3DPOLYLINE, SPLINE". To my large surprise the program began to process SPLINE.&lt;BR /&gt;But 3DPOLYLINE did not begin to process. I know that my actions are funny - I do not quite know lisp.&lt;BR /&gt;...&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;BLOCKQUOTE&gt;&lt;HR /&gt;@Anonymous wrote:&lt;BR /&gt;
&lt;P&gt;Try it&lt;/P&gt;
&lt;PRE&gt;(setq ss (ssget '((0 . "ARC,*LINE"))))
&amp;nbsp;
(if (setq ss2 (ssget "_C" pt pt '((0 . "ARC,*LINE"))))&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Hi Alexander,&lt;/P&gt;
&lt;P&gt;&lt;SPAN class="hps"&gt;please&lt;/SPAN&gt; &lt;SPAN class="hps alt-edited"&gt;be aware using the ssget filter &lt;SPAN class="hps"&gt;suggested&lt;/SPAN&gt; by v.azarko, we'll select MLINE, XLINE... too.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN class="hps alt-edited"&gt;&lt;SPAN class="hps"&gt;I would suggest&lt;/SPAN&gt; something like this, to select polylines, lines arcs and splines&lt;/SPAN&gt;&lt;/P&gt;
&lt;PRE&gt;(setq ss (ssget '((0 . "ARC,*POLYLINE,LINE,SPLINE"))))
 
(if (setq ss2 (ssget "_C" pt pt '((0 . "ARC,*POLYLINE,LINE,SPLINE"))))&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/568336"&gt;@АлексЮстасу&lt;/a&gt; wrote:&lt;BR /&gt;
&lt;P&gt;...&lt;BR /&gt;Now the program works notedly slower. It from the actions of&amp;nbsp; .-view, _.ucs,&amp;nbsp; .zoom?&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;&lt;SPAN class="hps alt-edited"&gt;Yes, the 'demo' will run &lt;SPAN class="hps"&gt;slower, because will &lt;SPAN class="hps"&gt;have to zoom to each selection &lt;SPAN class="hps"&gt;zone&lt;/SPAN&gt; to ensure that &lt;SPAN class="hps"&gt;the objects&lt;/SPAN&gt; &lt;SPAN&gt;are&lt;/SPAN&gt; &lt;SPAN class="hps"&gt;visible&lt;/SPAN&gt; &lt;SPAN class="hps"&gt;and&lt;/SPAN&gt; &lt;SPAN class="hps"&gt;will be selected...&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN class="hps alt-edited"&gt;&lt;SPAN class="hps"&gt;&lt;SPAN class="hps"&gt;&lt;SPAN class="hps"&gt;Hope this helps, &lt;BR /&gt;Henrique&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 07 Dec 2015 14:40:03 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/find-and-mark-gaps-lisp-repair/m-p/5939286#M136182</guid>
      <dc:creator>hmsilva</dc:creator>
      <dc:date>2015-12-07T14:40:03Z</dc:date>
    </item>
    <item>
      <title>Re: Find and Mark Gaps-Lisp Repair</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/find-and-mark-gaps-lisp-repair/m-p/5940111#M136183</link>
      <description>&lt;P&gt;This Code works a lot better. still getting false positives on the I-beam. I ran it on a larger data set and got some more false positives. added it to Grid-Test_V2. Thanks for all the help.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;IMG src="https://forums.autodesk.com/t5/image/serverpage/image-id/205141i438FD6CD04C62D7A/image-size/original?v=mpbl-1&amp;amp;px=-1" border="0" alt="gap-test2.JPG" title="gap-test2.JPG" /&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 07 Dec 2015 20:13:54 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/find-and-mark-gaps-lisp-repair/m-p/5940111#M136183</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2015-12-07T20:13:54Z</dc:date>
    </item>
    <item>
      <title>Re: Find and Mark Gaps-Lisp Repair</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/find-and-mark-gaps-lisp-repair/m-p/5940711#M136184</link>
      <description>&lt;P&gt;Hi, Henrique, thank you!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Мery little has false gaps applied the test file. (limit 1.0).&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;For me four questions are in general:&lt;BR /&gt;&lt;BR /&gt;1. How to do the search of Gaps taking into account Z, heights?&lt;BR /&gt;2. How to do the use of pre-selection?&lt;BR /&gt;3. How to do Enter instead of choice of objects - for the select all? (To leave the select objects, if there is not pre-selection)&lt;BR /&gt;3. And, do I confess, I do not understand why is Fluff needed? &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;BR /&gt;&lt;BR /&gt;But most important - at the use in the program of zoom, etc. treatment of the real files will be too long. And undo too long.&lt;/P&gt;</description>
      <pubDate>Tue, 08 Dec 2015 03:57:42 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/find-and-mark-gaps-lisp-repair/m-p/5940711#M136184</guid>
      <dc:creator>АлексЮстасу</dc:creator>
      <dc:date>2015-12-08T03:57:42Z</dc:date>
    </item>
    <item>
      <title>Re: Find and Mark Gaps-Lisp Repair</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/find-and-mark-gaps-lisp-repair/m-p/5940720#M136185</link>
      <description>&lt;P&gt;&lt;SPAN&gt;&lt;SPAN&gt;Also&lt;/SPAN&gt; &lt;SPAN&gt;false gap -&lt;/SPAN&gt; &lt;SPAN&gt;not always correctly&lt;/SPAN&gt; &lt;SPAN&gt;taken into account&lt;/SPAN&gt; &lt;SPAN&gt;the value of&lt;/SPAN&gt; &lt;SPAN&gt;the limit&lt;/SPAN&gt;&lt;/SPAN&gt;:&lt;BR /&gt;- &lt;EM&gt;GAP-Test_polyline_spline-more_limit10.png&lt;/EM&gt; - for 1.0,&lt;BR /&gt;- &lt;EM&gt;GAP-Test_polyline_spline-more_limit05.png&lt;/EM&gt; - for 0.5.&lt;/P&gt;</description>
      <pubDate>Tue, 08 Dec 2015 04:11:39 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/find-and-mark-gaps-lisp-repair/m-p/5940720#M136185</guid>
      <dc:creator>АлексЮстасу</dc:creator>
      <dc:date>2015-12-08T04:11:39Z</dc:date>
    </item>
    <item>
      <title>Re: Find and Mark Gaps-Lisp Repair</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/find-and-mark-gaps-lisp-repair/m-p/5941127#M136186</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/568336"&gt;@АлексЮстасу&lt;/a&gt; wrote:&lt;BR /&gt;
&lt;P&gt;Hi, Henrique, thank you!&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Мery little has false gaps applied the test file. (limit 1.0).&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;For me four questions are in general:&lt;BR /&gt;&lt;BR /&gt;1. How to do the search of Gaps taking into account Z, heights?&lt;BR /&gt;2. How to do the use of pre-selection?&lt;BR /&gt;3. How to do Enter instead of choice of objects - for the select all? (To leave the select objects, if there is not pre-selection)&lt;BR /&gt;3. And, do I confess, I do not understand why is Fluff needed? &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;BR /&gt;&lt;BR /&gt;But most important - at the use in the program of zoom, etc. treatment of the real files will be too long. And undo too long.&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;Hi Alexander, you're welcome!&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;
&lt;P&gt;1. How to do the search of Gaps taking into account Z, heights?&lt;/P&gt;
&lt;P&gt;Do you mean to &lt;SPAN class="hps"&gt;ignore the Z's?&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN class="hps"&gt;The code test for distance, so it will test all Z's...&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN class="hps"&gt;2 and 3 &lt;SPAN class="hps alt-edited"&gt;quickly&lt;/SPAN&gt; revised in 'demo'...&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN class="hps"&gt;I dont use the word 'Fluff' in my 'demo', I use the 'Maximum/Minimum Gap', and we have to set in code the maximum distance to scan objects, &lt;SPAN class="hps alt-edited"&gt;otherwise all objects &lt;SPAN class="alt-edited hps"&gt;would be&lt;/SPAN&gt; &lt;SPAN class="hps"&gt;marked with&lt;/SPAN&gt; &lt;SPAN class="hps"&gt;a circle&lt;/SPAN&gt;.&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN class="hps"&gt;&lt;SPAN class="hps alt-edited"&gt;But most important - at the use in the program of zoom, etc. treatment of the real files will be too long. And undo too long.&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN class="hps"&gt;&lt;SPAN class="hps alt-edited"&gt;Alexander, my code is just a 'demo', &lt;SPAN&gt;It is not a&lt;/SPAN&gt; &lt;SPAN class="hps"&gt;finished program&lt;/SPAN&gt;, nor is it &lt;SPAN class="hps"&gt;my intention.&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN class="hps"&gt;&lt;SPAN class="hps alt-edited"&gt;&lt;SPAN class="hps"&gt;To&amp;nbsp;rewrite the&amp;nbsp;&lt;SPAN class="hps"&gt;code without using 'selections' it would be necessary to have free time, and currently I'm&amp;nbsp;in&lt;SPAN class="hps"&gt; big&lt;/SPAN&gt; &lt;SPAN class="hps"&gt;workload...&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;(vl-load-com)
(defun c:demo (/ *error* get_glob_real mk_circle hnd i lst obj ori pt pt1 pt2 ss ss1 ss2)

   (defun *error* (msg)
      (if command-s
         (progn (command-s "_.-view" "_R" "temp_h")
                (command-s "_.-view" "_D" "temp_h")
         )
         (vl-cmdf "_.-view" "_R" "temp_h" "_.-view" "_D" "temp_h")
      )
      (vla-endundomark acdoc)
      (cond ((not msg))
            ((member msg '("Function cancelled" "quit / exit abort")))
            ((princ (strcat "\n** Error: " msg " ** ")))
      )
      (princ)
   )

   (defun get_glob_real (var msg mod prec def / tmpH)
      (if (or (not var) (/= (type var) 'REAL))
         (setq var def)
      )
      (initget 6)
      (setq tmpH (getreal (strcat "\n" msg " &amp;lt;" (rtos var mod prec) "&amp;gt;: ")))
      (if (/= tmpH nil)
         (setq var tmpH)
      )
      var
   )

   (defun mk_circle (pt dia)
      (entmake
         (list
            '(0 . "CIRCLE")
            '(8 . "GAP")
            (cons 10 pt)
            (cons 40 (/ dia 2.0))
            '(62 . 1)
         )
      )
   )

   (or acdoc (setq acdoc (vla-get-activedocument (vlax-get-acad-object))))
   (vla-startundomark acdoc)
   (vl-cmdf "_.-view" "_S" "temp_h" "_.ucs" "_W")
   (if (and (setq *_max_fuzz (get_glob_real *_max_fuzz "\n Enter Maximum Gap" 2 3 1.00))
            (setq *_min_fuzz (get_glob_real *_min_fuzz "\n Enter Minimum Gap" 2 3 0.001))
            (setq *_dia (get_glob_real *_dia "\n Enter Circle Size" 2 2 0.50))
            (princ "\n Select objects or &amp;lt;ENTER&amp;gt; for all: ")
            (or (setq ss (ssget '((0 . "ARC,LINE,*POLYLINE,SPLINE"))))
                (setq ss (ssget "_X" (list '(0 . "ARC,LINE,*POLYLINE,SPLINE") (cons 410 (getvar 'ctab)))))
            )
       )
      (progn
         (repeat (setq i (sslength ss))
            (setq hnd (ssname ss (setq i (1- i)))
                  lst (cons (vlax-curve-getstartpoint hnd) lst)
                  lst (cons (vlax-curve-getendpoint hnd) lst)
            )
         )
         (while lst
            (setq pt  (car lst)
                  lst (cdr lst)
            )
            (if (not (vl-some '(lambda (p) (equal p pt *_min_fuzz)) lst))
               (if (and (vl-cmdf "_.zoom"
                                 (setq pt1 (list (- (car pt) *_max_fuzz) (- (cadr pt) *_max_fuzz)))
                                 (setq pt2 (list (+ (car pt) *_max_fuzz) (+ (cadr pt) *_max_fuzz)))
                        )
                        (setq ss1 (ssget "_C" pt1 pt2))
                   )
                  (if (setq ss2 (ssget "_C" pt pt '((0 . "ARC,LINE,*POLYLINE,SPLINE"))))
                     (progn
                        (setq ori (ssname ss2 0))
                        (repeat (setq i (sslength ss1))
                           (setq hnd (ssname ss1 (setq i (1- i)))
                                 obj (vlax-ename-&amp;gt;vla-object hnd)
                           )
                           (if (ssmemb hnd ss)
                              (if (and (not (eq ori hnd))
                                       (not (vlax-curve-getParamAtPoint obj pt))
                                       (&amp;lt; (distance pt (vlax-curve-getClosestPointTo obj pt)) *_max_fuzz)
                                  )
                                 (mk_circle pt *_dia)
                                 (if (and (eq ori hnd)
                                          (wcmatch (vla-get-objectname obj) "*Polyline,*Spline")
                                          (= (vla-get-closed obj) :vlax-false)
                                          (&amp;gt; (vlax-curve-getdistatparam obj (vlax-curve-getendparam obj)) *_max_fuzz)
                                          (&amp;lt;= *_min_fuzz (distance (vlax-curve-getStartPoint obj) (vlax-curve-getEndPoint obj)) *_max_fuzz)
                                     )
                                    (mk_circle pt *_dia)
                                 )
                              )
                           )
                        )
                     )
                  )
               )
            )
            (setq lst (vl-remove-if '(lambda (p) (equal p pt *_min_fuzz)) lst))
         )
      )
   )
   (*error* nil)
   (princ)
)&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN class="hps"&gt;&lt;SPAN class="hps alt-edited"&gt;&lt;SPAN class="hps"&gt;&lt;SPAN class="hps"&gt;&lt;SPAN class="hps"&gt;Hope this helps, &lt;BR /&gt;Henrique&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 08 Dec 2015 11:52:19 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/find-and-mark-gaps-lisp-repair/m-p/5941127#M136186</guid>
      <dc:creator>hmsilva</dc:creator>
      <dc:date>2015-12-08T11:52:19Z</dc:date>
    </item>
    <item>
      <title>Re: Find and Mark Gaps-Lisp Repair</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/find-and-mark-gaps-lisp-repair/m-p/5941630#M136187</link>
      <description>&lt;P&gt;&lt;SPAN&gt;Hi, Henrique,&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Now Enter=all does not work&lt;/SPAN&gt;&lt;/P&gt;&lt;PRE&gt;&amp;nbsp;Select objects or &amp;lt;ENTER&amp;gt; for all:&lt;BR /&gt;Select objects:&lt;BR /&gt;_.-view Enter an option [?/Delete/Orthographic/Restore/Save/sEttings/Window]: _R Enter view name to restore: temp_h&lt;BR /&gt;Command: _.-view Enter an option [?/Delete/Orthographic/Restore/Save/sEttings/Window]: _D&lt;BR /&gt;Enter view name(s) to delete: temp_h&lt;BR /&gt;Command:&lt;BR /&gt;** Error: bad argument value: AcDbCurve 112 **&lt;BR /&gt;
&lt;/PRE&gt;&lt;BLOCKQUOTE&gt;&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/75977"&gt;@hmsilva&lt;/a&gt; wrote:&lt;BR /&gt;&lt;BLOCKQUOTE&gt;&lt;HR /&gt;Do you mean to &lt;SPAN&gt;ignore the Z's?&lt;/SPAN&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;&lt;SPAN&gt;The code test for distance, so it will test all Z's...&lt;/SPAN&gt;&lt;/P&gt;&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;&amp;nbsp;&lt;SPAN style="line-height: 15px;"&gt;Yes, not to ignore Z, elevation etc.&amp;nbsp;It is now made well.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/75977"&gt;@hmsilva&lt;/a&gt; wrote:&lt;BR /&gt;&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;SPAN&gt;&lt;SPAN&gt;my code is just a 'demo', &lt;SPAN&gt;It is not a&lt;/SPAN&gt; &lt;SPAN&gt;finished program&lt;/SPAN&gt;, nor is it &lt;SPAN&gt;my intention.&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&amp;nbsp;&lt;/BLOCKQUOTE&gt;&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;&lt;SPAN style="line-height: 15px;"&gt;Yes, it is clear. But the principle of dependence on zoom etc&amp;nbsp;it is impossible to avoid?&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Still there are markers, disputable for me, - on the ends of "polyline" from many pieces:&lt;/P&gt;&lt;P&gt;&lt;IMG src="https://forums.autodesk.com/t5/image/serverpage/image-id/205313iF64853C513ED61EF/image-size/original?v=mpbl-1&amp;amp;px=-1" border="0" alt="GAP-Test_polyline_spline-false_gap_2.png" title="GAP-Test_polyline_spline-false_gap_2.png" width="446" height="358" /&gt;&lt;/P&gt;&lt;P&gt;Also there is one unclear case at maximum Gap - 1.0, minimum Gap - 0.5:&lt;/P&gt;&lt;P&gt;&lt;IMG src="https://forums.autodesk.com/t5/image/serverpage/image-id/205315iBD52D3310CD8885F/image-size/original?v=mpbl-1&amp;amp;px=-1" border="0" alt="GAP-Test_polyline_spline-false_gap10-05.png" title="GAP-Test_polyline_spline-false_gap10-05.png" width="463" height="346" /&gt;&lt;/P&gt;&lt;/BLOCKQUOTE&gt;&lt;/BLOCKQUOTE&gt;</description>
      <pubDate>Tue, 08 Dec 2015 15:18:02 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/find-and-mark-gaps-lisp-repair/m-p/5941630#M136187</guid>
      <dc:creator>АлексЮстасу</dc:creator>
      <dc:date>2015-12-08T15:18:02Z</dc:date>
    </item>
  </channel>
</rss>

