<?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: Snap polyline vertex to the nearest COGO point in Visual LISP, AutoLISP and General Customization Forum</title>
    <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/snap-polyline-vertex-to-the-nearest-cogo-point/m-p/12552788#M17941</link>
    <description>&lt;P&gt;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/13495647"&gt;@lzedCB&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;&lt;P&gt;I think it can be done, but not totally automatically.&amp;nbsp; The user has to initiate some command to make it run, as I would prefer it not to have to use a reactor.&amp;nbsp; Besides, an object that fires a reactor can not be a subject of a reaction.&lt;/P&gt;&lt;P&gt;In fact it could process the whole drawing at once but should have some built-in limitations like certain layers or pairs thereof (point and polyline), and maximum distance to adjust a vertex.&amp;nbsp; If a vertex is beyond the maximum distance, but the polyline goes right past a point, then do you want to add a vertex?&lt;/P&gt;&lt;P&gt;BTW, what does "V" stand for?&amp;nbsp; Oh, I see it's actually a check mark.&amp;nbsp; That could be anything.&lt;/P&gt;</description>
    <pubDate>Sat, 10 Feb 2024 18:44:13 GMT</pubDate>
    <dc:creator>john.uhden</dc:creator>
    <dc:date>2024-02-10T18:44:13Z</dc:date>
    <item>
      <title>Snap polyline vertex to the nearest COGO point</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/snap-polyline-vertex-to-the-nearest-cogo-point/m-p/12551940#M17938</link>
      <description>&lt;P&gt;Hello!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Any brillant mind knows how to do a LISP that snaps polylines vertices (keeping them at elevation = 0) to the neareast/closest COGO point, but only for COGO points that has layer state "ON" and "not freeze" being shown on screen, then joins all polylines that are snapped to the same point but that are not continous/joined polyline?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;This video shows a example of the proccess, but imagine having like hundreds of points and polylines to fix their snapping:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;div class="lia-vid-container video-embed-center"&gt;&lt;div id="lia-vid-6346590033112w720h540r117" class="lia-video-brightcove-player-container"&gt;&lt;video-js data-video-id="6346590033112" data-account="6057940548001" data-player="default" data-embed="default" class="vjs-fluid" controls="" data-application-id="" style="width: 100%; height: 100%;"&gt;&lt;/video-js&gt;&lt;/div&gt;&lt;script src="https://players.brightcove.net/6057940548001/default_default/index.min.js"&gt;&lt;/script&gt;&lt;script&gt;(function() {  var wrapper = document.getElementById('lia-vid-6346590033112w720h540r117');  var videoEl = wrapper ? wrapper.querySelector('video-js') : null;  if (videoEl) {     if (window.videojs) {       window.videojs(videoEl).ready(function() {         this.on('loadedmetadata', function() {           this.el().querySelectorAll('.vjs-load-progress div[data-start]').forEach(function(bar) {             bar.setAttribute('role', 'presentation');             bar.setAttribute('aria-hidden', 'true');           });         });       });     }  }})();&lt;/script&gt;&lt;a class="video-embed-link" href="https://forums.autodesk.com/t5/video/gallerypage/video-id/6346590033112"&gt;(view in My Videos)&lt;/a&gt;&lt;/div&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;So it would be like a LISP where you make a cross window around the polylines and COGO points you want to snap them, so it will "fix" snap them automatically? Is it possible? Thanks in advance!&lt;/P&gt;</description>
      <pubDate>Sat, 10 Feb 2024 01:46:20 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/snap-polyline-vertex-to-the-nearest-cogo-point/m-p/12551940#M17938</guid>
      <dc:creator>lzedCB</dc:creator>
      <dc:date>2024-02-10T01:46:20Z</dc:date>
    </item>
    <item>
      <title>Re: Snap polyline vertex to the nearest COGO point</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/snap-polyline-vertex-to-the-nearest-cogo-point/m-p/12551945#M17939</link>
      <description>&lt;P&gt;First question why is line work not snapping to correct point ? Are you using say CIV3D and importing points ? It should create lines correctly, or some other spaghetti solution of importing points and lines.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Re spaghetti, if you do line connections incorrectly you end up with spaghetti.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Yes can take a COGO point and draw a little box around it then using a ssget method to look for objects near to it. If single p/line then easy gets complicated when a point is near a segment of a pline.&lt;/P&gt;</description>
      <pubDate>Sat, 10 Feb 2024 01:53:23 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/snap-polyline-vertex-to-the-nearest-cogo-point/m-p/12551945#M17939</guid>
      <dc:creator>Sea-Haven</dc:creator>
      <dc:date>2024-02-10T01:53:23Z</dc:date>
    </item>
    <item>
      <title>Re: Snap polyline vertex to the nearest COGO point</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/snap-polyline-vertex-to-the-nearest-cogo-point/m-p/12551953#M17940</link>
      <description>&lt;P&gt;Cable lines Sometimes are targeted separated from "pole" symbols. So, you don't get exactly same spot for both, but they should be represented trought the center of symbol. It's very specific, but it happens...&lt;/P&gt;</description>
      <pubDate>Sat, 10 Feb 2024 02:03:05 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/snap-polyline-vertex-to-the-nearest-cogo-point/m-p/12551953#M17940</guid>
      <dc:creator>lzedCB</dc:creator>
      <dc:date>2024-02-10T02:03:05Z</dc:date>
    </item>
    <item>
      <title>Re: Snap polyline vertex to the nearest COGO point</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/snap-polyline-vertex-to-the-nearest-cogo-point/m-p/12552788#M17941</link>
      <description>&lt;P&gt;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/13495647"&gt;@lzedCB&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;&lt;P&gt;I think it can be done, but not totally automatically.&amp;nbsp; The user has to initiate some command to make it run, as I would prefer it not to have to use a reactor.&amp;nbsp; Besides, an object that fires a reactor can not be a subject of a reaction.&lt;/P&gt;&lt;P&gt;In fact it could process the whole drawing at once but should have some built-in limitations like certain layers or pairs thereof (point and polyline), and maximum distance to adjust a vertex.&amp;nbsp; If a vertex is beyond the maximum distance, but the polyline goes right past a point, then do you want to add a vertex?&lt;/P&gt;&lt;P&gt;BTW, what does "V" stand for?&amp;nbsp; Oh, I see it's actually a check mark.&amp;nbsp; That could be anything.&lt;/P&gt;</description>
      <pubDate>Sat, 10 Feb 2024 18:44:13 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/snap-polyline-vertex-to-the-nearest-cogo-point/m-p/12552788#M17941</guid>
      <dc:creator>john.uhden</dc:creator>
      <dc:date>2024-02-10T18:44:13Z</dc:date>
    </item>
    <item>
      <title>Re: Snap polyline vertex to the nearest COGO point</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/snap-polyline-vertex-to-the-nearest-cogo-point/m-p/12553011#M17942</link>
      <description>&lt;P&gt;Just a comment I did something like this for a client DWG, changing say 500 items takes a couple of seconds.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Do you know anything about lisp ?&lt;/P&gt;</description>
      <pubDate>Sat, 10 Feb 2024 23:08:01 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/snap-polyline-vertex-to-the-nearest-cogo-point/m-p/12553011#M17942</guid>
      <dc:creator>Sea-Haven</dc:creator>
      <dc:date>2024-02-10T23:08:01Z</dc:date>
    </item>
    <item>
      <title>Re: Snap polyline vertex to the nearest COGO point</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/snap-polyline-vertex-to-the-nearest-cogo-point/m-p/12553029#M17943</link>
      <description>Hy friend! I have no clue about LISP. Anyways, I was thinking it was "easier" task or LISP. I'm thankful for your toughts on this.</description>
      <pubDate>Sat, 10 Feb 2024 23:33:39 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/snap-polyline-vertex-to-the-nearest-cogo-point/m-p/12553029#M17943</guid>
      <dc:creator>lzedCB</dc:creator>
      <dc:date>2024-02-10T23:33:39Z</dc:date>
    </item>
    <item>
      <title>Re: Snap polyline vertex to the nearest COGO point</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/snap-polyline-vertex-to-the-nearest-cogo-point/m-p/12553184#M17944</link>
      <description>&lt;P&gt;Before any one can help you need a sample dwg. Need to know block names etc.&lt;/P&gt;</description>
      <pubDate>Sun, 11 Feb 2024 03:13:35 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/snap-polyline-vertex-to-the-nearest-cogo-point/m-p/12553184#M17944</guid>
      <dc:creator>Sea-Haven</dc:creator>
      <dc:date>2024-02-11T03:13:35Z</dc:date>
    </item>
    <item>
      <title>Re: Snap polyline vertex to the nearest COGO point</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/snap-polyline-vertex-to-the-nearest-cogo-point/m-p/12553754#M17945</link>
      <description>&lt;P&gt;Here is an example file! Thnks in advance.&lt;/P&gt;</description>
      <pubDate>Sun, 11 Feb 2024 17:12:28 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/snap-polyline-vertex-to-the-nearest-cogo-point/m-p/12553754#M17945</guid>
      <dc:creator>lzedCB</dc:creator>
      <dc:date>2024-02-11T17:12:28Z</dc:date>
    </item>
    <item>
      <title>Re: Snap polyline vertex to the nearest COGO point</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/snap-polyline-vertex-to-the-nearest-cogo-point/m-p/12554641#M17946</link>
      <description>&lt;P&gt;Possibly something like this.&lt;/P&gt;
&lt;P&gt;No layer filtering or anything. Just select the plines with cogos and if there some point within the given distance from some vertex, it will fix the coords.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;(vl-load-com)

(defun c:&lt;STRONG&gt;SnapPlines2CogoFuzz&lt;/STRONG&gt; nil

  (or (and *SPL2C-fuzz* (numberp *SPL2C-fuzz*))
      (setq *SPL2C-fuzz* 1))
  (setq *SPL2C-fuzz* (cond ((getdist (strcat "\nSpecify value of fuzzy &amp;lt;" (rtos *SPL2C-fuzz*) "&amp;gt;: "))) (*SPL2C-fuzz*))))


(defun c:&lt;STRONG&gt;SnapPlines2Cogo&lt;/STRONG&gt; ( / s l i e d) 
  
  (if (and (setq s (ssget  '((0 . "AECC_COGO_POINT,LWPOLYLINE"))))
	   (setq l (ssget "_P" '((0 . "AECC_COGO_POINT"))))
	   (setq l (vl-remove-if 'listp (mapcar 'cadr (ssnamex l))))
	   (setq l (mapcar '(lambda (x) (vlax-get (vlax-ename-&amp;gt;vla-object x) 'Location)) l))
	   (setq l (mapcar '(lambda (x) (reverse (cdr (reverse x)))) l))
	   (or *SPL2C-fuzz* (c:SnapPlines2CogoFuzz))
	   )
    (repeat (setq i (sslength s))
      (setq e (ssname s (setq i (1- i)))
	    d (entget e))
      (if (= "LWPOLYLINE" (cdr (assoc 0 d)))
	(entmod (mapcar '(lambda (x / p)
			   (if (= (car x) 10)
			     (progn
			       (setq p (cdr x))
			       (setq l (vl-sort l '(lambda (x1 x2) (&amp;lt; (distance p x1) (distance p x2)))))
			       (cons 10 (if (&amp;lt; (distance (car l) p) *SPL2C-fuzz*)
					  (car l) p))) 			
			     x))
			d)))))
  (princ)
  )
&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 12 Feb 2024 13:39:07 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/snap-polyline-vertex-to-the-nearest-cogo-point/m-p/12554641#M17946</guid>
      <dc:creator>ВeekeeCZ</dc:creator>
      <dc:date>2024-02-12T13:39:07Z</dc:date>
    </item>
    <item>
      <title>Re: Snap polyline vertex to the nearest COGO point</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/snap-polyline-vertex-to-the-nearest-cogo-point/m-p/12554661#M17947</link>
      <description>&lt;P&gt;is that written for autocad? since it is autocad topic.&lt;/P&gt;</description>
      <pubDate>Mon, 12 Feb 2024 09:37:03 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/snap-polyline-vertex-to-the-nearest-cogo-point/m-p/12554661#M17947</guid>
      <dc:creator>komondormrex</dc:creator>
      <dc:date>2024-02-12T09:37:03Z</dc:date>
    </item>
    <item>
      <title>Re: Snap polyline vertex to the nearest COGO point</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/snap-polyline-vertex-to-the-nearest-cogo-point/m-p/12554740#M17948</link>
      <description>&lt;P&gt;No. The OP has C3D.&lt;/P&gt;</description>
      <pubDate>Mon, 12 Feb 2024 10:16:41 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/snap-polyline-vertex-to-the-nearest-cogo-point/m-p/12554740#M17948</guid>
      <dc:creator>ВeekeeCZ</dc:creator>
      <dc:date>2024-02-12T10:16:41Z</dc:date>
    </item>
    <item>
      <title>Re: Snap polyline vertex to the nearest COGO point</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/snap-polyline-vertex-to-the-nearest-cogo-point/m-p/12554848#M17949</link>
      <description>&lt;P&gt;Thanks&amp;nbsp;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/1779365"&gt;@ВeekeeCZ&lt;/a&gt;. This is more than enough and works together with Isolate and Unisolated command, so it's not necessary any filter as it can be easily Isolated just the polylines and points of interest before applying this LISP! Would be perfect with the fuzz distance could be specified while running the LISP.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks for sharing with us such a brillant mind!&lt;/P&gt;</description>
      <pubDate>Mon, 12 Feb 2024 11:21:32 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/snap-polyline-vertex-to-the-nearest-cogo-point/m-p/12554848#M17949</guid>
      <dc:creator>lzedCB</dc:creator>
      <dc:date>2024-02-12T11:21:32Z</dc:date>
    </item>
    <item>
      <title>Re: Snap polyline vertex to the nearest COGO point</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/snap-polyline-vertex-to-the-nearest-cogo-point/m-p/12555078#M17950</link>
      <description>&lt;P&gt;Code updated.&lt;/P&gt;
&lt;P&gt;Set it for the first time. Then change it by SnapPlines2CogoFuzz.&lt;/P&gt;</description>
      <pubDate>Mon, 12 Feb 2024 13:42:51 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/snap-polyline-vertex-to-the-nearest-cogo-point/m-p/12555078#M17950</guid>
      <dc:creator>ВeekeeCZ</dc:creator>
      <dc:date>2024-02-12T13:42:51Z</dc:date>
    </item>
    <item>
      <title>Re: Snap polyline vertex to the nearest COGO point</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/snap-polyline-vertex-to-the-nearest-cogo-point/m-p/12555281#M17951</link>
      <description>&lt;P&gt;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/1779365"&gt;@ВeekeeCZ&lt;/a&gt;&amp;nbsp;Thanks! It worked perfectly here.&amp;nbsp;&lt;span class="lia-unicode-emoji" title=":hugging_face:"&gt;🤗&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 12 Feb 2024 15:01:50 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/snap-polyline-vertex-to-the-nearest-cogo-point/m-p/12555281#M17951</guid>
      <dc:creator>lzedCB</dc:creator>
      <dc:date>2024-02-12T15:01:50Z</dc:date>
    </item>
    <item>
      <title>Re: Snap polyline vertex to the nearest COGO point</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/snap-polyline-vertex-to-the-nearest-cogo-point/m-p/13219148#M17952</link>
      <description>Would it be possible to modify the routine to accommodate feature lines and elevation data?</description>
      <pubDate>Wed, 18 Dec 2024 20:44:30 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/snap-polyline-vertex-to-the-nearest-cogo-point/m-p/13219148#M17952</guid>
      <dc:creator>kmohs</dc:creator>
      <dc:date>2024-12-18T20:44:30Z</dc:date>
    </item>
    <item>
      <title>Re: Snap polyline vertex to the nearest COGO point</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/snap-polyline-vertex-to-the-nearest-cogo-point/m-p/13219637#M17953</link>
      <description>&lt;P&gt;It may be better to start a new post and provide more visual information like images or best a dwg.&lt;/P&gt;</description>
      <pubDate>Thu, 19 Dec 2024 03:27:14 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/snap-polyline-vertex-to-the-nearest-cogo-point/m-p/13219637#M17953</guid>
      <dc:creator>Sea-Haven</dc:creator>
      <dc:date>2024-12-19T03:27:14Z</dc:date>
    </item>
  </channel>
</rss>

