<?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: To merge / add two polylines by removing intersecting part using (entmod ...) or (vlax-put ...) in Visual LISP, AutoLISP and General Customization Forum</title>
    <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/to-merge-add-two-polylines-by-removing-intersecting-part-using/m-p/9864093#M67674</link>
    <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/1067754"&gt;@mmkkmmv&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;DIV class="lia-message-body lia-component-message-view-widget-body lia-component-body-signature-highlight-escalation lia-component-message-view-widget-body-signature-highlight-escalation"&gt;
&lt;DIV class="lia-message-body-content"&gt;
&lt;P&gt;...&lt;/P&gt;
&lt;P&gt;Is below code is correct method to follow, to join 2 lwpoly using "vlax-put ..." ?&lt;/P&gt;
&lt;P&gt;I tried below code&lt;STRONG&gt;, but it is not working if lwpoly is closed or open with its start, end points at same location, any suggestions?&lt;BR /&gt;&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;...&lt;/P&gt;
&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The is really no magic function that will solve the issue for you. All the hard work is up to you.&lt;/P&gt;
&lt;P&gt;And honestly,&amp;nbsp;with this approach of yours, you are doomed to failure.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The question of 'how to do' is really the minor issue here.&lt;/P&gt;
&lt;P&gt;The real question is 'what to do'. And the first step has to be to elaborate on the issue in detail. Not for us, for yourself. I've done this (partially) for you... you to see how much COMPLEX the issue is. Then you can start to build your program. Good luck, honestly! Be systematic, or you will fail.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Z9E3zK5E_0-1605174849151.png" style="width: 400px;"&gt;&lt;img src="https://forums.autodesk.com/t5/image/serverpage/image-id/843442i0DEF36EEFBEE58F1/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Z9E3zK5E_0-1605174849151.png" alt="Z9E3zK5E_0-1605174849151.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Thu, 12 Nov 2020 10:20:05 GMT</pubDate>
    <dc:creator>ВeekeeCZ</dc:creator>
    <dc:date>2020-11-12T10:20:05Z</dc:date>
    <item>
      <title>To merge / add two polylines by removing intersecting part using (entmod ...) or (vlax-put ...)</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/to-merge-add-two-polylines-by-removing-intersecting-part-using/m-p/9861987#M67662</link>
      <description>&lt;DIV class="lia-message-body lia-component-message-view-widget-body lia-component-body-signature-highlight-escalation lia-component-message-view-widget-body-signature-highlight-escalation"&gt;&lt;DIV class="lia-message-body-content"&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;To merge 2 polylines by removing intersecting part using (entmod ...) or (vlax-put ...) see snapshot below :&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="mmkkmmv_1-1605105909981.png" style="width: 400px;"&gt;&lt;img src="https://forums.autodesk.com/t5/image/serverpage/image-id/843083i69F9B5AD2F3FFCF0/image-size/medium?v=v2&amp;amp;px=400" role="button" title="mmkkmmv_1-1605105909981.png" alt="mmkkmmv_1-1605105909981.png" /&gt;&lt;/span&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Is below code is correct method to follow, to join 2 lwpoly using "vlax-put ..." ?&lt;/P&gt;&lt;P&gt;I tried below code&lt;STRONG&gt;, but it is not working if lwpoly is closed or open with its start, end points at same location, any suggestions?&lt;BR /&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="general"&gt;;;; e1 to join with e2 lwpoly
(defun c:test(/ e1 e2 )
(vl-load-com)
  (setq e1(car(entsel))
        e2(car(entsel))
	obj1 (vlax-ename-&amp;gt;vla-object e1)
  	obj2 (vlax-ename-&amp;gt;vla-object e2)        
  	;pts1(vlax-get obj1 'Coordinates)
  	;pts2(vlax-get obj2 'Coordinates)
  ) ; end setq

  (if (= (cdr(assoc 0 (entget e1))) "LWPOLYLINE") (PROGN
    (setq e1_pts (mapcar 'cdr (vl-remove-if-not '(lambda (x) (= (car x) 10)) (entget e1))))
  )) ; end if
  
  (if (= (cdr(assoc 0 (entget e2))) "LWPOLYLINE")(PROGN
    (setq e2_pts (mapcar 'cdr (vl-remove-if-not '(lambda (x) (= (car x) 10)) (entget e2))))
  )) ; end if
  
  (setq st_pt(car e2_pts)
        end_pt (last e2_pts)
   	idx1(vlax-curve-getparamatpoint e1 st_pt)
        idx2(vlax-curve-getparamatpoint e1 end_pt)
  	idx1_fix(fix(vlax-curve-getparamatpoint e1 st_pt))
        idx2_fix(fix(vlax-curve-getparamatpoint e1 end_pt))
        reverse1 nil
  ) ; setq 
  
  (if (&amp;lt;= idx1_fix idx2_fix) (progn
  (if (&amp;lt; idx1_fix idx2_fix) (progn
  (setq c1 0
   	list1 '()
  	list2 '()) ; setq
  
  (if (= (zerop (- idx1_fix idx1)) nil) (progn
  (repeat (+ idx1_fix 1)    
  	(setq list1(append list1 (list (nth c1 e1_pts))))
  	(setq c1(1+ c1))
  ) ; repeat
  )) ; if &amp;amp; progn
  (setq c2 (1+ idx2_fix))  
  (repeat (- (- (length e1_pts) 1) idx2_fix)
  (setq list2(append list2 (list (nth c2 e1_pts) ) ))
    (setq c2(1+ c2))
    ) ; repeat  
  )
 (progn ; if both index equal
  ;  if required
   ) ; progn
    ) ; if
  )) ; if &amp;amp; progn
  
 (if (&amp;gt; idx1_fix idx2_fix) (progn
  (setq reverse1 T  
  	c1 (1- (length e1_pts))
  	list1 '()
  	list2 '()) ;setq
  (if (= (zerop (- idx1_fix idx1)) nil) (progn
  (repeat (- (1- (length e1_pts)) idx1_fix)    
  	(setq list1(append list1 (list (nth c1 e1_pts))))
  	(setq c1(1- c1))
  ) ; repeat
  )) ; if &amp;amp; progn
  
  (setq list1(reverse list1)) ; to check
  (setq c2 0)  
  (repeat (+ idx2_fix 1)
  	(setq list2(append list2 (list (nth c2 e1_pts) ) ))
    	(setq c2(1+ c2))
  ) ; repeat 
  )) ;if &amp;amp; progn
  
  (setq new_coords '())
  (if (= reverse1 nil)(progn
  (setq new_coords(append list1 e2_pts list2))
  )
    (progn
      (setq new_coords(append list2 (reverse e2_pts) list1))
      )
    ) ; if

  (setq obj_coords '())  
  (foreach item new_coords
    (setq obj_coords (append obj_coords (list (car item) (cadr item)) )   )
	)
  (vlax-put obj1 'Coordinates obj_coords )
  (command ".erase" e2 "")
  (vlax-release-object obj1)
  (vlax-release-object obj2)
  (princ) 
  
  ) ; end defun&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;suggestions will be helpful&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks &amp;amp; Regards,&lt;/P&gt;&lt;P&gt;(mmkkmmv)&lt;/P&gt;</description>
      <pubDate>Wed, 11 Nov 2020 14:55:10 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/to-merge-add-two-polylines-by-removing-intersecting-part-using/m-p/9861987#M67662</guid>
      <dc:creator>mmkkmmv</dc:creator>
      <dc:date>2020-11-11T14:55:10Z</dc:date>
    </item>
    <item>
      <title>Re: To merge / add two polylines by removing intersecting part using (entmod ...) or (vlax-put ...)</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/to-merge-add-two-polylines-by-removing-intersecting-part-using/m-p/9862003#M67663</link>
      <description>&lt;P&gt;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/1067754"&gt;@mmkkmmv&lt;/a&gt;&amp;nbsp;For better understanding, and maybe get further help, please upload such sample.dwg&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 11 Nov 2020 15:00:16 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/to-merge-add-two-polylines-by-removing-intersecting-part-using/m-p/9862003#M67663</guid>
      <dc:creator>devitg</dc:creator>
      <dc:date>2020-11-11T15:00:16Z</dc:date>
    </item>
    <item>
      <title>Re: To merge / add two polylines by removing intersecting part using (entmod ...) or (vlax-put ...)</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/to-merge-add-two-polylines-by-removing-intersecting-part-using/m-p/9862025#M67664</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/58962"&gt;@devitg&lt;/a&gt;please refer above snapshot, its like breaking intersecting part of two lwpoly &amp;amp; joining, but using vlax-put or entmod because in some of the cases break or trim may not work&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks &amp;amp; Regards,&lt;/P&gt;&lt;P&gt;(mmkkmmv)&lt;/P&gt;</description>
      <pubDate>Wed, 11 Nov 2020 15:09:37 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/to-merge-add-two-polylines-by-removing-intersecting-part-using/m-p/9862025#M67664</guid>
      <dc:creator>mmkkmmv</dc:creator>
      <dc:date>2020-11-11T15:09:37Z</dc:date>
    </item>
    <item>
      <title>Re: To merge / add two polylines by removing intersecting part using (entmod ...) or (vlax-put ...)</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/to-merge-add-two-polylines-by-removing-intersecting-part-using/m-p/9862035#M67665</link>
      <description>&lt;P&gt;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/1067754"&gt;@mmkkmmv&lt;/a&gt;&amp;nbsp;&amp;nbsp;As far as I know, ACAD only can edit DWG.&lt;/P&gt;</description>
      <pubDate>Wed, 11 Nov 2020 15:14:27 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/to-merge-add-two-polylines-by-removing-intersecting-part-using/m-p/9862035#M67665</guid>
      <dc:creator>devitg</dc:creator>
      <dc:date>2020-11-11T15:14:27Z</dc:date>
    </item>
    <item>
      <title>Re: To merge / add two polylines by removing intersecting part using (entmod ...) or (vlax-put ...)</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/to-merge-add-two-polylines-by-removing-intersecting-part-using/m-p/9862113#M67666</link>
      <description>&lt;P&gt;Why not a simple trim then join?&lt;/P&gt;</description>
      <pubDate>Wed, 11 Nov 2020 15:43:31 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/to-merge-add-two-polylines-by-removing-intersecting-part-using/m-p/9862113#M67666</guid>
      <dc:creator>ronjonp</dc:creator>
      <dc:date>2020-11-11T15:43:31Z</dc:date>
    </item>
    <item>
      <title>Re: To merge / add two polylines by removing intersecting part using (entmod ...) or (vlax-put ...)</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/to-merge-add-two-polylines-by-removing-intersecting-part-using/m-p/9862137#M67667</link>
      <description>&lt;P&gt;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/58962"&gt;@devitg&lt;/a&gt;sample.dwg attached for your reference, below is snapshot :&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="mmkkmmv_0-1605109499291.png" style="width: 400px;"&gt;&lt;img src="https://forums.autodesk.com/t5/image/serverpage/image-id/843103i0226122430197BF9/image-size/medium?v=v2&amp;amp;px=400" role="button" title="mmkkmmv_0-1605109499291.png" alt="mmkkmmv_0-1605109499291.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;(mmkkmmv)&lt;/P&gt;</description>
      <pubDate>Wed, 11 Nov 2020 15:52:47 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/to-merge-add-two-polylines-by-removing-intersecting-part-using/m-p/9862137#M67667</guid>
      <dc:creator>mmkkmmv</dc:creator>
      <dc:date>2020-11-11T15:52:47Z</dc:date>
    </item>
    <item>
      <title>Re: To merge / add two polylines by removing intersecting part using (entmod ...) or (vlax-put ...)</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/to-merge-add-two-polylines-by-removing-intersecting-part-using/m-p/9862171#M67668</link>
      <description>&lt;P&gt;[In the case of the right-side before-&amp;amp;-after with the closed white one, whether it's truly "closed" or "open" with its start and end points in the same place, if the yellow one touches (or crosses) the white one at both ends, you can just use BOUNDARY or BPOLY.]&lt;/P&gt;</description>
      <pubDate>Wed, 11 Nov 2020 16:10:30 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/to-merge-add-two-polylines-by-removing-intersecting-part-using/m-p/9862171#M67668</guid>
      <dc:creator>Kent1Cooper</dc:creator>
      <dc:date>2020-11-11T16:10:30Z</dc:date>
    </item>
    <item>
      <title>Re: To merge / add two polylines by removing intersecting part using (entmod ...) or (vlax-put ...)</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/to-merge-add-two-polylines-by-removing-intersecting-part-using/m-p/9862192#M67669</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/1067754"&gt;@mmkkmmv&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;&lt;SPAN style="font-family: inherit;"&gt;.... in some of the cases break or trim may not work&amp;nbsp;&lt;/SPAN&gt;....&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;Does that mean that the yellow one may not always actually touch the white one?&amp;nbsp; I haven't studied how it figures the new set of coordinates to use, but does it depend on the end vertices of the yellow one coinciding with vertices in the white one?&lt;/P&gt;</description>
      <pubDate>Wed, 11 Nov 2020 16:16:01 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/to-merge-add-two-polylines-by-removing-intersecting-part-using/m-p/9862192#M67669</guid>
      <dc:creator>Kent1Cooper</dc:creator>
      <dc:date>2020-11-11T16:16:01Z</dc:date>
    </item>
    <item>
      <title>Re: To merge / add two polylines by removing intersecting part using (entmod ...) or (vlax-put ...)</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/to-merge-add-two-polylines-by-removing-intersecting-part-using/m-p/9862268#M67670</link>
      <description>&lt;P&gt;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/69526"&gt;@Kent1Cooper&lt;/a&gt;&amp;nbsp; yellow color lwpoly will always snap to white one, and at right side white color poly (in snapshot) is closed&amp;nbsp; and it can be open with start, end point at same location, any suggestions in above code given?&lt;/P&gt;</description>
      <pubDate>Wed, 11 Nov 2020 16:51:12 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/to-merge-add-two-polylines-by-removing-intersecting-part-using/m-p/9862268#M67670</guid>
      <dc:creator>mmkkmmv</dc:creator>
      <dc:date>2020-11-11T16:51:12Z</dc:date>
    </item>
    <item>
      <title>Re: To merge / add two polylines by removing intersecting part using (entmod ...) or (vlax-put ...)</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/to-merge-add-two-polylines-by-removing-intersecting-part-using/m-p/9862425#M67671</link>
      <description>&lt;P&gt;I can't take the time right now to study the code and understand how it makes its new coordinates list -- maybe later.&amp;nbsp; The syntax of the (vlax-put...) looks correct to me, and you can certainly change the shape of a Polyline by giving it a new Coordinates list like that, if you don't need to deal with the complications of arc segments.&amp;nbsp; It's just a question of how that list is built.&amp;nbsp; The best way to do that may be affected by whether the start/end of a closed [or apparently-closed] white one is within the to-be-removed range -- would that ever happen?&lt;/P&gt;</description>
      <pubDate>Wed, 11 Nov 2020 17:36:03 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/to-merge-add-two-polylines-by-removing-intersecting-part-using/m-p/9862425#M67671</guid>
      <dc:creator>Kent1Cooper</dc:creator>
      <dc:date>2020-11-11T17:36:03Z</dc:date>
    </item>
    <item>
      <title>Re: To merge / add two polylines by removing intersecting part using (entmod ...) or (vlax-put ...)</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/to-merge-add-two-polylines-by-removing-intersecting-part-using/m-p/9862500#M67672</link>
      <description>&lt;P&gt;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/69526"&gt;@Kent1Cooper&lt;/a&gt;&amp;nbsp; the major issue is from closed (or apparently closed) lwpoly, i have got two entities to process in code (white, yellow ones) i have tried trim, break in code but its not working in all cases (especially with closed ones), I have checked "-Boundary" command (its a nice suggestion) but how to get inside point (there are many other lwpoly surrounding them), actually these are contours lines, user will modify these contours(lwpolylines) if it is bumpy&amp;nbsp; to somewhat straighten them or vice versa, there are many contours going round and round adjacent to each other, to get "internal point" is difficult for me, any suggestions?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;(mmkkmmv)&lt;/P&gt;</description>
      <pubDate>Wed, 11 Nov 2020 18:09:19 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/to-merge-add-two-polylines-by-removing-intersecting-part-using/m-p/9862500#M67672</guid>
      <dc:creator>mmkkmmv</dc:creator>
      <dc:date>2020-11-11T18:09:19Z</dc:date>
    </item>
    <item>
      <title>Re: To merge / add two polylines by removing intersecting part using (entmod ...) or (vlax-put ...)</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/to-merge-add-two-polylines-by-removing-intersecting-part-using/m-p/9862893#M67673</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/1067754"&gt;@mmkkmmv&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;.... these are contours lines, user will modify these contours(lwpolylines) if it is bumpy&amp;nbsp; to somewhat straighten them or vice versa, there are many contours going round and round adjacent to each other, to get "internal point" is difficult for me, any suggestions?&lt;/P&gt;
&lt;P&gt;....&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;That makes BOUNDARY/BPOLY less likely to be useful, because there would be &lt;EM&gt;two&lt;/EM&gt;&amp;nbsp; resulting objects, one along the inner and one the outer edge of the space the internal point is in.&amp;nbsp; But if you could count on &lt;EM&gt;always&lt;/EM&gt;&amp;nbsp; wanting the same one [e.g. the outer one], that could be determined by comparing areas.&lt;/P&gt;</description>
      <pubDate>Wed, 11 Nov 2020 21:06:46 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/to-merge-add-two-polylines-by-removing-intersecting-part-using/m-p/9862893#M67673</guid>
      <dc:creator>Kent1Cooper</dc:creator>
      <dc:date>2020-11-11T21:06:46Z</dc:date>
    </item>
    <item>
      <title>Re: To merge / add two polylines by removing intersecting part using (entmod ...) or (vlax-put ...)</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/to-merge-add-two-polylines-by-removing-intersecting-part-using/m-p/9864093#M67674</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/1067754"&gt;@mmkkmmv&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;DIV class="lia-message-body lia-component-message-view-widget-body lia-component-body-signature-highlight-escalation lia-component-message-view-widget-body-signature-highlight-escalation"&gt;
&lt;DIV class="lia-message-body-content"&gt;
&lt;P&gt;...&lt;/P&gt;
&lt;P&gt;Is below code is correct method to follow, to join 2 lwpoly using "vlax-put ..." ?&lt;/P&gt;
&lt;P&gt;I tried below code&lt;STRONG&gt;, but it is not working if lwpoly is closed or open with its start, end points at same location, any suggestions?&lt;BR /&gt;&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;...&lt;/P&gt;
&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The is really no magic function that will solve the issue for you. All the hard work is up to you.&lt;/P&gt;
&lt;P&gt;And honestly,&amp;nbsp;with this approach of yours, you are doomed to failure.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The question of 'how to do' is really the minor issue here.&lt;/P&gt;
&lt;P&gt;The real question is 'what to do'. And the first step has to be to elaborate on the issue in detail. Not for us, for yourself. I've done this (partially) for you... you to see how much COMPLEX the issue is. Then you can start to build your program. Good luck, honestly! Be systematic, or you will fail.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Z9E3zK5E_0-1605174849151.png" style="width: 400px;"&gt;&lt;img src="https://forums.autodesk.com/t5/image/serverpage/image-id/843442i0DEF36EEFBEE58F1/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Z9E3zK5E_0-1605174849151.png" alt="Z9E3zK5E_0-1605174849151.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 12 Nov 2020 10:20:05 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/to-merge-add-two-polylines-by-removing-intersecting-part-using/m-p/9864093#M67674</guid>
      <dc:creator>ВeekeeCZ</dc:creator>
      <dc:date>2020-11-12T10:20:05Z</dc:date>
    </item>
    <item>
      <title>Re: To merge / add two polylines by removing intersecting part using (entmod ...) or (vlax-put ...)</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/to-merge-add-two-polylines-by-removing-intersecting-part-using/m-p/9869965#M67675</link>
      <description>&lt;P&gt;Thinking conceptually only (because my own laptop is temporarily not available), it seems that...&lt;/P&gt;
&lt;P&gt;0.&amp;nbsp; You probably have to check that both are at the same elevation&lt;/P&gt;
&lt;P&gt;1.&amp;nbsp; You need to find out if the two polylines intersect (probably using extendboth or maybe just the lesser one).&lt;/P&gt;
&lt;P&gt;2.&amp;nbsp; Trim or break the greater one at the points of intersection.&amp;nbsp; BUT, if its start and end are within the area to be trimmed then you will probably have to trim twice.&amp;nbsp; If it's&amp;nbsp; closed within that area then maybe one trim will do but I can't test right now to see if that's true.&lt;/P&gt;
&lt;P&gt;3.&amp;nbsp; Perhaps trim the lesser one if it overlaps the greater&lt;/P&gt;
&lt;P&gt;4.&amp;nbsp; At this point you may be able to join the greater (both parts) with the lesser and you're done, though I have had plenty of experiences where AutoCAD just won't join them.&amp;nbsp; I had to write my own PJOIN command to be sure it worked every time.&amp;nbsp; But my code is not accessible right now to tell you what that entails.&lt;/P&gt;
&lt;P&gt;4 (alternate).&amp;nbsp; You would have to sort all the vertices to be headed in the right direction, remove any duplicates where they were trimmed, get all their bulges in the same order and vlax-put the coordinates and bulges while at the same time considering if the greater was closed, because if you are as **** as I you don't want to create an unecessary vertex.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Oh, BTW, you have probably noticed that the coordinate list is what is called a flat list.&amp;nbsp; I don't have it with me, but my&amp;nbsp;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/8108781"&gt;@group&lt;/a&gt; function is handy for converting (x1 y1 x2 y2 xn yn) to ((x1 y1)(x2 y2)(xn yn)).&amp;nbsp; You might be able to find it searching the forum, or I'll try to remember to post it on Monday 'cause I left my flash drive at work.&lt;/P&gt;
&lt;P&gt;Then, to put the list of points back to flat, all you have to do is (apply 'append 2dlist).&lt;/P&gt;
&lt;P&gt;Gotta go as my mind is drifting toward the prime strip steak I bought for dinner and I want my cocktails first.&lt;/P&gt;</description>
      <pubDate>Sat, 14 Nov 2020 23:49:34 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/to-merge-add-two-polylines-by-removing-intersecting-part-using/m-p/9869965#M67675</guid>
      <dc:creator>john.uhden</dc:creator>
      <dc:date>2020-11-14T23:49:34Z</dc:date>
    </item>
    <item>
      <title>Re: To merge / add two polylines by removing intersecting part using (entmod ...) or (vlax-put ...)</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/to-merge-add-two-polylines-by-removing-intersecting-part-using/m-p/9871034#M67676</link>
      <description>&lt;P&gt;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/1067754"&gt;@mmkkmmv&lt;/a&gt;&amp;nbsp;:&lt;/P&gt;
&lt;P&gt;It was there.&amp;nbsp; I just found it for you...&lt;/P&gt;
&lt;PRE&gt;(defun @group (old n / item new)
  (while old
    (while (&amp;lt; (length item) n)
      (setq item (cons (car old) item) old (cdr old))
    )
    (setq new (cons (reverse item) new) item nil)
  )
  (reverse new)
)&lt;/PRE&gt;
&lt;P&gt;which can be used as follows:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;Command: (setq coords '(1 2 3 4 5 6 7 8 9)
Command: (@group coords 3)
((1 2 3) (4 5 6) (7 8 9))

or

Command: (setq coords '(1 2 3 4 5 6 7 8)
Command: (@group coords 2)
((1 2)(3 4)(5 6)(7 8))&lt;/PRE&gt;</description>
      <pubDate>Sun, 15 Nov 2020 19:33:54 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/to-merge-add-two-polylines-by-removing-intersecting-part-using/m-p/9871034#M67676</guid>
      <dc:creator>john.uhden</dc:creator>
      <dc:date>2020-11-15T19:33:54Z</dc:date>
    </item>
    <item>
      <title>Re: To merge / add two polylines by removing intersecting part using (entmod ...) or (vlax-put ...)</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/to-merge-add-two-polylines-by-removing-intersecting-part-using/m-p/9871128#M67677</link>
      <description>&lt;P&gt;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/3930636"&gt;@john.uhden&lt;/a&gt;&amp;nbsp;Hi , it is what I use, from the unforgettable Fatty TOH and also known as Fixo at Augi&amp;nbsp; &amp;nbsp;, who helped to all us. Sad to say he had passed away about 5 years ago.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="fixo avatar augi.png" style="width: 385px;"&gt;&lt;img src="https://forums.autodesk.com/t5/image/serverpage/image-id/844539iF335110C604C033A/image-size/large?v=v2&amp;amp;px=999" role="button" title="fixo avatar augi.png" alt="fixo avatar augi.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;LI-CODE lang="general"&gt;;;;GROUP
;;;LIST
;;;BY
;;;NUMBER
 ; written by Fatty T.O.H
(DEFUN GROUP-BY-NUM/lst-num  (LST
                      NUM
                      /
                      LS
 ;ret
                      )
  (IF (= (REM (LENGTH LST) NUM) 0)
    (PROGN
      (SETQ LS NIL)
      (REPEAT (/ (LENGTH LST) NUM)
        (REPEAT NUM
          (SETQ LS
                    (CONS (CAR LST) LS)
                LST (CDR LST)))
        (SETQ RET (APPEND RET (LIST (REVERSE LS)))
              LS  NIL)))
    )
  RET
  )

&lt;/LI-CODE&gt;&lt;P&gt;God bless him .&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sun, 15 Nov 2020 21:06:22 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/to-merge-add-two-polylines-by-removing-intersecting-part-using/m-p/9871128#M67677</guid>
      <dc:creator>devitg</dc:creator>
      <dc:date>2020-11-15T21:06:22Z</dc:date>
    </item>
    <item>
      <title>Re: To merge / add two polylines by removing intersecting part using (entmod ...) or (vlax-put ...)</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/to-merge-add-two-polylines-by-removing-intersecting-part-using/m-p/9871226#M67678</link>
      <description>&lt;P&gt;Well, I was outta here for about 10 years, so I don't remember Fatty or Fixo, but I like mine better.&lt;/P&gt;
&lt;P&gt;Anyway, I haven't time tested, but (vl-remove-if-not-dxf10) &amp;lt;that's not a real function but a nickname for the process&amp;gt; might be faster than&amp;nbsp;@grouping a flat list.&amp;nbsp; I dunno.&amp;nbsp; I guess the correct answer is whatever works for you.&amp;nbsp; When you are removing ravaiolis from a pot, does it matter whether the holes in your big spoon are round or oval?&lt;/P&gt;</description>
      <pubDate>Sun, 15 Nov 2020 22:33:45 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/to-merge-add-two-polylines-by-removing-intersecting-part-using/m-p/9871226#M67678</guid>
      <dc:creator>john.uhden</dc:creator>
      <dc:date>2020-11-15T22:33:45Z</dc:date>
    </item>
    <item>
      <title>Re: To merge / add two polylines by removing intersecting part using (entmod ...) or (vlax-put ...)</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/to-merge-add-two-polylines-by-removing-intersecting-part-using/m-p/9871312#M67679</link>
      <description>&lt;P&gt;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/3930636"&gt;@john.uhden&lt;/a&gt;&amp;nbsp;, did not say which is better , the Fatty defun controls if the list length is multiple of the group to do .&amp;nbsp;&lt;/P&gt;&lt;P&gt;Of course that flat list from variants are always 2 or 3 multiple, but group could be any other number .&amp;nbsp;&lt;/P&gt;&lt;P&gt;About Fatty , he participate at the .net forum&amp;nbsp; at ADSK, and very often at AUGI. I get references from others lispers , taht Fatty was a good helper.&amp;nbsp;&lt;/P&gt;&lt;P&gt;About raviolis, I hope hole are smaller than raviolis.&lt;/P&gt;</description>
      <pubDate>Sun, 15 Nov 2020 23:29:15 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/to-merge-add-two-polylines-by-removing-intersecting-part-using/m-p/9871312#M67679</guid>
      <dc:creator>devitg</dc:creator>
      <dc:date>2020-11-15T23:29:15Z</dc:date>
    </item>
    <item>
      <title>Re: To merge / add two polylines by removing intersecting part using (entmod ...) or (vlax-put ...)</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/to-merge-add-two-polylines-by-removing-intersecting-part-using/m-p/9871649#M67680</link>
      <description>&lt;P&gt;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/1779365"&gt;@ВeekeeCZ&lt;/a&gt;wrote :&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;...&lt;BR /&gt;I've done this (partially) for you...&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;@Z9E3zK5E thanks for your effort&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;(mmkkmmv)&lt;/P&gt;</description>
      <pubDate>Mon, 16 Nov 2020 04:48:14 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/to-merge-add-two-polylines-by-removing-intersecting-part-using/m-p/9871649#M67680</guid>
      <dc:creator>mmkkmmv</dc:creator>
      <dc:date>2020-11-16T04:48:14Z</dc:date>
    </item>
    <item>
      <title>Re: To merge / add two polylines by removing intersecting part using (entmod ...) or (vlax-put ...)</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/to-merge-add-two-polylines-by-removing-intersecting-part-using/m-p/9871662#M67681</link>
      <description>&lt;P&gt;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/3930636"&gt;@john.uhden&lt;/a&gt;wrote&lt;/P&gt;&lt;P&gt;It was there. I just found it for you...&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/3930636"&gt;@john.uhden&lt;/a&gt;thanks for your effort to get the code, i appreciate that, it might useful to convert vla-.. 'coordinates in pairs or any other use as required, its just a suggestion for everyone, need to put some condition before 'while' to avoid 'reset break loop' if n is 0 or less in said function [@group (old n /)]&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks again for effort and reply&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;(mmkkmmv)&lt;/P&gt;</description>
      <pubDate>Mon, 16 Nov 2020 05:13:32 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/to-merge-add-two-polylines-by-removing-intersecting-part-using/m-p/9871662#M67681</guid>
      <dc:creator>mmkkmmv</dc:creator>
      <dc:date>2020-11-16T05:13:32Z</dc:date>
    </item>
  </channel>
</rss>

