<?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: Pick four lines and 2 come up duplicate in Visual LISP, AutoLISP and General Customization Forum</title>
    <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/pick-four-lines-and-2-come-up-duplicate/m-p/8382955#M97246</link>
    <description>&lt;P&gt;pick for lines at once and that are in this shape get the endpoints of each line too&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Tue, 06 Nov 2018 13:09:51 GMT</pubDate>
    <dc:creator>cadking2k5</dc:creator>
    <dc:date>2018-11-06T13:09:51Z</dc:date>
    <item>
      <title>Pick four lines and 2 come up duplicate</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/pick-four-lines-and-2-come-up-duplicate/m-p/8381665#M97242</link>
      <description>&lt;P&gt;I don't know who gave this mapcar to me but two of&amp;nbsp; four lines are coming up as a&amp;nbsp;duplicate here are the four lines I am picking&lt;/P&gt;&lt;P&gt;(setq lns (mapcar '(lambda (x) (cdr (reverse (vl-remove-if-not 'listp (mapcar 'cdr (entget x))))))&lt;BR /&gt;(vl-remove-if 'listp (mapcar 'cadr (ssnamex (ssget '((0 . "line")))))))); give the endpoints of all the lines you select&lt;BR /&gt;(setq os (getvar "osmode"))&lt;BR /&gt;(setvar "osmode" 0)&lt;BR /&gt;(command "undo" "BE")&lt;BR /&gt;(setq ln1 (nth 0 lns))&lt;BR /&gt;(setq ln1s (car ln1))&lt;BR /&gt;(setq ln1e (cadr ln1))&lt;BR /&gt;(setq ln2 (nth 1 lns))&lt;BR /&gt;(setq ln2s (car ln2))&lt;BR /&gt;(setq ln2e (cadr ln2))&lt;BR /&gt;(setq ln3 (nth 2 lns))&lt;BR /&gt;(setq ln3s (car ln3))&lt;BR /&gt;(setq ln3e (cadr ln3))&lt;BR /&gt;(setq ln4 (nth 3 lns))&lt;BR /&gt;(setq ln4s (car ln4))&lt;BR /&gt;(setq ln4e (cadr ln4))&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="oe.JPG" style="width: 318px;"&gt;&lt;img src="https://forums.autodesk.com/t5/image/serverpage/image-id/565892iE9FEFBB2844F6C68/image-size/large?v=v2&amp;amp;px=999" role="button" title="oe.JPG" alt="oe.JPG" /&gt;&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 05 Nov 2018 22:07:45 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/pick-four-lines-and-2-come-up-duplicate/m-p/8381665#M97242</guid>
      <dc:creator>cadking2k5</dc:creator>
      <dc:date>2018-11-05T22:07:45Z</dc:date>
    </item>
    <item>
      <title>Re: Pick four lines and 2 come up duplicate</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/pick-four-lines-and-2-come-up-duplicate/m-p/8381839#M97243</link>
      <description>&lt;P&gt;Umm, what are you trying to do?&lt;/P&gt;
&lt;P&gt;It seems as though you want to pick four lines.&amp;nbsp; Then what?&lt;/P&gt;</description>
      <pubDate>Tue, 06 Nov 2018 00:19:06 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/pick-four-lines-and-2-come-up-duplicate/m-p/8381839#M97243</guid>
      <dc:creator>john.uhden</dc:creator>
      <dc:date>2018-11-06T00:19:06Z</dc:date>
    </item>
    <item>
      <title>Betreff: Pick four lines and 2 come up duplicate</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/pick-four-lines-and-2-come-up-duplicate/m-p/8382298#M97244</link>
      <description>&lt;P&gt;Your problem description is a bit difficult to understand, but let's try it:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I suppose you get mixed up because your selected lines are not all going in the direction you would like.&lt;BR /&gt;Please use the command _.RECTANG, apply _.EXPLODE and test again.&lt;BR /&gt;Do you like the result better?&lt;BR /&gt;&lt;BR /&gt;Then please look at exactly where your lines (with the problem) start and end.&lt;/P&gt;</description>
      <pubDate>Tue, 06 Nov 2018 07:52:15 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/pick-four-lines-and-2-come-up-duplicate/m-p/8382298#M97244</guid>
      <dc:creator>cadffm</dc:creator>
      <dc:date>2018-11-06T07:52:15Z</dc:date>
    </item>
    <item>
      <title>Betreff: Pick four lines and 2 come up duplicate</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/pick-four-lines-and-2-come-up-duplicate/m-p/8382936#M97245</link>
      <description>&lt;P&gt;those are 4 different lines&lt;/P&gt;</description>
      <pubDate>Tue, 06 Nov 2018 13:06:36 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/pick-four-lines-and-2-come-up-duplicate/m-p/8382936#M97245</guid>
      <dc:creator>cadking2k5</dc:creator>
      <dc:date>2018-11-06T13:06:36Z</dc:date>
    </item>
    <item>
      <title>Re: Pick four lines and 2 come up duplicate</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/pick-four-lines-and-2-come-up-duplicate/m-p/8382955#M97246</link>
      <description>&lt;P&gt;pick for lines at once and that are in this shape get the endpoints of each line too&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 06 Nov 2018 13:09:51 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/pick-four-lines-and-2-come-up-duplicate/m-p/8382955#M97246</guid>
      <dc:creator>cadking2k5</dc:creator>
      <dc:date>2018-11-06T13:09:51Z</dc:date>
    </item>
    <item>
      <title>Re: Pick four lines and 2 come up duplicate</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/pick-four-lines-and-2-come-up-duplicate/m-p/8383013#M97247</link>
      <description>&lt;P&gt;This code should do the same without a&amp;nbsp;mapcar.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;(defun c:4lines ( / ss)

  (if (and (setq ss (ssget '((0 . "LINE"))))
           (or (= 4 (sslength ss))
               (alert "Error: Wrong selection, 4 lines required!")))
    (setq ln1 (ssname ss 0)
          ln1s (cdr (assoc 10 (entget ln1)))
          ln1e (cdr (assoc 11 (entget ln1)))
          ln2 (ssname ss 1)
          ln2s (cdr (assoc 10 (entget ln2)))
          ln2e (cdr (assoc 11 (entget ln2)))
          ln3 (ssname ss 2)
          ln3s (cdr (assoc 10 (entget ln3)))
          ln3e (cdr (assoc 11 (entget ln3)))
          ln4 (ssname ss 3)
          ln4s (cdr (assoc 10 (entget ln4)))
          ln4e (cdr (assoc 11 (entget ln4)))))
  (princ)
)&lt;/PRE&gt;</description>
      <pubDate>Tue, 06 Nov 2018 13:32:20 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/pick-four-lines-and-2-come-up-duplicate/m-p/8383013#M97247</guid>
      <dc:creator>ВeekeeCZ</dc:creator>
      <dc:date>2018-11-06T13:32:20Z</dc:date>
    </item>
    <item>
      <title>Re: Pick four lines and 2 come up duplicate</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/pick-four-lines-and-2-come-up-duplicate/m-p/8383169#M97248</link>
      <description>&lt;P&gt;Perhaps:&lt;/P&gt;&lt;PRE&gt;(cond
  ((and (setq s (ssget '((0 . "line")))) (setq s (vl-remove-if 'listp (mapcar 'cadr (ssnamex s)))))
   (setq lns (mapcar 'cdr
		     (vl-remove-if-not
		       '(lambda (x) (member (car x) '(10 11)))
		       (apply 'append (mapcar 'entget s))
		     )
	     )
   )
  )
)&lt;/PRE&gt;</description>
      <pubDate>Tue, 06 Nov 2018 14:18:33 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/pick-four-lines-and-2-come-up-duplicate/m-p/8383169#M97248</guid>
      <dc:creator>ronjonp</dc:creator>
      <dc:date>2018-11-06T14:18:33Z</dc:date>
    </item>
    <item>
      <title>Re: Pick four lines and 2 come up duplicate</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/pick-four-lines-and-2-come-up-duplicate/m-p/8383396#M97249</link>
      <description>&lt;P&gt;A possibility:&amp;nbsp; You actually have &lt;EM&gt;five&lt;/EM&gt;&amp;nbsp; Lines, two of them coinciding, those two are among the first four in the selection, and since the extraction of endpoints only goes through the first four, it never gets to the remaining Line.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Check when selecting that it &lt;EM&gt;says it found four&lt;/EM&gt;.&amp;nbsp; If so, then I don't have any better ideas....&lt;/P&gt;</description>
      <pubDate>Tue, 06 Nov 2018 15:39:00 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/pick-four-lines-and-2-come-up-duplicate/m-p/8383396#M97249</guid>
      <dc:creator>Kent1Cooper</dc:creator>
      <dc:date>2018-11-06T15:39:00Z</dc:date>
    </item>
    <item>
      <title>Re: Pick four lines and 2 come up duplicate</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/pick-four-lines-and-2-come-up-duplicate/m-p/8383705#M97250</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I do not get anything wrong in your code.....&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am totally agree with&amp;nbsp;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/69526"&gt;@Kent1Cooper&lt;/a&gt;&amp;nbsp;, but not possibly, actually there is&amp;nbsp;more than 4 lines ........&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;First thing&lt;/STRONG&gt; are you selecting lines by &lt;STRONG&gt;window selection&lt;/STRONG&gt;, then&amp;nbsp;if you check the point list (using "&lt;STRONG&gt;!lns&lt;/STRONG&gt;"), you should get more than 8 set of "&lt;STRONG&gt;X,Y,Z&lt;/STRONG&gt;" co-ordinates......&amp;nbsp;that's why you are getting duplicates.......&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Either check the drawings or try to select the lines individually ...... I am sure you should not get any&amp;nbsp;&lt;SPAN&gt;duplicates.....&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 06 Nov 2018 17:37:19 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/pick-four-lines-and-2-come-up-duplicate/m-p/8383705#M97250</guid>
      <dc:creator>dbhunia</dc:creator>
      <dc:date>2018-11-06T17:37:19Z</dc:date>
    </item>
  </channel>
</rss>

