<?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 : Remove duplicate points from a list in Visual LISP, AutoLISP and General Customization Forum</title>
    <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/remove-duplicate-points-from-a-list/m-p/6561049#M128705</link>
    <description>&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Another trick you can try on performance-critical code: VL-POSITION is clearly faster than MEMBER (or at least it was last time I measured it).&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;- in general code I don't recommend this (unless you are really interested in the position), as it hides the programmer intent.&lt;/P&gt;&lt;P&gt;- This is an implementation error in AutoLISP: as VL-POSITION does more work, it should actually be slower, so the MEMBER implementation is somehow bungled.&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>Wed, 14 Sep 2016 09:08:17 GMT</pubDate>
    <dc:creator>martti.halminen</dc:creator>
    <dc:date>2016-09-14T09:08:17Z</dc:date>
    <item>
      <title>Remove duplicate points from a list</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/remove-duplicate-points-from-a-list/m-p/6552151#M128694</link>
      <description>&lt;P&gt;Chaps,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Can anybody speed up this code that removes duplicate coordinates from a list? Six points obviously isn't a problem but I'm working mainly with 100k points.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;(setq TRI_Points '((0.0 0.0 0.0) (0.0 0.0 0.0) (10.0 0.0 0.0) (10.0 0.0 0.0) (0.0 0.0 0.1) (10.0 0.0 0.0)))
; stripped to :  '((0.0 0.0 0.0) (10.0 0.0 0.0) (0.0 0.0 0.1))
(setq TRI_StrippedPoints (list (car TRI_Points))
      TRI_Points (cdr TRI_Points)
      )
(repeat (length TRI_Points)
  (setq TRI_checkpoint (car TRI_Points)
	TRI_checkX (car TRI_checkpoint)
	TRI_checkY (cadr TRI_checkpoint)
	TRI_checkZ (caddr TRI_checkpoint)
	TRI_check T
	)
  (foreach TRI_temp TRI_StrippedPoints
    (setq TRI_tempX (car TRI_temp)
	  TRI_tempY (cadr TRI_temp)
	  TRI_tempZ (caddr TRI_temp)
	  )
    (if (and
	  (equal TRI_tempX TRI_checkX 0.0001)
	  (equal TRI_tempY TRI_checkY 0.0001)
	  (equal TRI_tempZ TRI_checkZ 0.0001)
	  )
      (setq TRI_check nil)
      )
    )
  (if TRI_check
    (setq TRI_StrippedPoints (append TRI_StrippedPoints (list TRI_checkpoint)))
    )
  (setq TRI_Points (cdr TRI_Points))
  )&lt;/PRE&gt;</description>
      <pubDate>Fri, 09 Sep 2016 11:31:42 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/remove-duplicate-points-from-a-list/m-p/6552151#M128694</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2016-09-09T11:31:42Z</dc:date>
    </item>
    <item>
      <title>Re : Remove duplicate points from a list</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/remove-duplicate-points-from-a-list/m-p/6552230#M128695</link>
      <description>&lt;P&gt;Hi&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;For example&lt;/P&gt;&lt;PRE&gt;(while TRI_Points
  (setq lst (cons (car TRI_Points) lst)
	TRI_Points (vl-remove (car TRI_Points) TRI_Points)
  )
)

(reverse lst)&lt;/PRE&gt;&lt;P&gt;An another from &lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/109424"&gt;@_gile&lt;/a&gt;&lt;/P&gt;&lt;PRE&gt;(defun remove_doubles (lst)
  (if lst
    (cons (car lst) (remove_doubles (vl-remove (car lst) lst)))
  )
)

(remove_doubles '((0.0 0.0 0.0) (0.0 0.0 0.0) (10.0 0.0 0.0) (10.0 0.0 0.0) (0.0 0.0 0.1) (10.0 0.0 0.0)))&lt;/PRE&gt;&lt;P&gt;@+&lt;/P&gt;</description>
      <pubDate>Fri, 09 Sep 2016 12:07:31 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/remove-duplicate-points-from-a-list/m-p/6552230#M128695</guid>
      <dc:creator>patrick_35</dc:creator>
      <dc:date>2016-09-09T12:07:31Z</dc:date>
    </item>
    <item>
      <title>Re : Remove duplicate points from a list</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/remove-duplicate-points-from-a-list/m-p/6552273#M128696</link>
      <description>&lt;PRE&gt;(setq TRI_Points '((0.0 0.0 0.0) (0.0 0.0 0.0) (10.0 0.0 0.0) (10.0 0.0 0.0) (0.0 0.0 0.1) (10.0 0.0 0.0)))
(setq TRI_StrippedPoints nil)

(setq n 0)

(repeat (length TRI_Points)
	(setq item (nth n TRI_Points))
	(if (not (member item TRI_StrippedPoints))
		(progn
			(setq TRI_StrippedPoints (cons item TRI_StrippedPoints))
		);progn
	);if
	(setq n (1+ n))
);repeat&lt;/PRE&gt;</description>
      <pubDate>Fri, 09 Sep 2016 12:25:48 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/remove-duplicate-points-from-a-list/m-p/6552273#M128696</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2016-09-09T12:25:48Z</dc:date>
    </item>
    <item>
      <title>Re : Remove duplicate points from a list</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/remove-duplicate-points-from-a-list/m-p/6552286#M128697</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;An another one, I don't know if is fastest!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;(defun remove_multi ( l / nw_l )
  (mapcar
    '(lambda (x)
      (if (not (member x nw_l))
        (setq nw_l (cons x nw_l))
      )
    )
    l
  )
  nw_l
)&lt;/PRE&gt;&lt;P&gt;(remove_multi tri_points) -&amp;gt; ((0.0 0.0 0.1) (10.0 0.0 0.0) (0.0 0.0 0.0))&lt;/P&gt;</description>
      <pubDate>Fri, 09 Sep 2016 12:33:55 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/remove-duplicate-points-from-a-list/m-p/6552286#M128697</guid>
      <dc:creator>CADaSchtroumpf</dc:creator>
      <dc:date>2016-09-09T12:33:55Z</dc:date>
    </item>
    <item>
      <title>Re: Remove duplicate points from a list</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/remove-duplicate-points-from-a-list/m-p/6552398#M128698</link>
      <description>&lt;P&gt;Thanks to all.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I had started along these lines but then headed off along the "compare" route which was clearly the wrong direction.&lt;/P&gt;</description>
      <pubDate>Fri, 09 Sep 2016 13:19:22 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/remove-duplicate-points-from-a-list/m-p/6552398#M128698</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2016-09-09T13:19:22Z</dc:date>
    </item>
    <item>
      <title>Re: Remove duplicate points from a list</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/remove-duplicate-points-from-a-list/m-p/6552756#M128699</link>
      <description>&lt;P&gt;Another way:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;(&lt;FONT color="#FF0000"&gt;foreach&lt;/FONT&gt; pt TRI_Points
  (if (not (member pt TRI_StrippedPoints))
    (setq TRI_StrippedPoints (cons pt TRI_StrippedPoints))
  )
  (reverse TRI_StrippedPoints); [only if necessary]
)&lt;/PRE&gt;
&lt;P&gt;or, if you want them in the original order, a way without the (reverse) function:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;(foreach pt TRI_Points
  (if (not (member pt TRI_StrippedPoints))
    (setq TRI_StrippedPoints (append TRI_StrippedPoints (list pt)))
  )
  TRI_StrippedPoints
)&lt;/PRE&gt;
&lt;P&gt;But I do wonder: &amp;nbsp;If any of these points could come from some kind of &lt;EM&gt;calculation&lt;/EM&gt;, such as a (polar) function based off another point, or extracted from objects' entity data compared with something like Object-snap selections of the same points, and they wouldn't always be "clean" whole-number coordinates, then you might get points that are "duplicates" for your purposes but that AutoLisp would &lt;EM&gt;not&lt;/EM&gt; consider the same [i.e. with differences 12 or 15 decimal places down]. &amp;nbsp;If such things are possible, a comparison function using (equal) with a fuzz factor, such as in your code in Post 1, would be needed.&lt;/P&gt;</description>
      <pubDate>Fri, 09 Sep 2016 15:00:25 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/remove-duplicate-points-from-a-list/m-p/6552756#M128699</guid>
      <dc:creator>Kent1Cooper</dc:creator>
      <dc:date>2016-09-09T15:00:25Z</dc:date>
    </item>
    <item>
      <title>Re: Remove duplicate points from a list</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/remove-duplicate-points-from-a-list/m-p/6554545#M128700</link>
      <description>&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Cannot figure what direction you meant,&lt;/P&gt;&lt;P&gt;but a common method of removing doubles&lt;/P&gt;&lt;P&gt;is, as Kent mentioned, by the proximities.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;L would be your list of 3 element lists, ie points;&lt;/P&gt;&lt;P&gt;and D as the nearness distance, maybe 1e-14,&lt;/P&gt;&lt;P&gt;or even 1e-4 for manual measurements.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp; ; remove_doubles,&amp;nbsp; SomeBuddy+&lt;BR /&gt;&amp;nbsp; (defun L_RemEqu (L D / X)&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; (cond ((atom L) L)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; (T (cons (car L) (L_RemEqu&lt;BR /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; (vl-remove-if '(lambda (x) (equal (car L) X D)) L) D)))) ) ;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;For very big lists, a slightly different code may be needed.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 10 Sep 2016 13:50:05 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/remove-duplicate-points-from-a-list/m-p/6554545#M128700</guid>
      <dc:creator>stevor</dc:creator>
      <dc:date>2016-09-10T13:50:05Z</dc:date>
    </item>
    <item>
      <title>Re: Remove duplicate points from a list</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/remove-duplicate-points-from-a-list/m-p/6556507#M128701</link>
      <description>&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;If we are having performance problems due to long lists, using APPEND is a bad idea: it has to copy all its arguments except the last. The CONS + REVERSE trick is much faster.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;One undocumented trick for the comparisons: EQUAL works with a fuzz factor also for lists of numbers in addition to single numbers, so you can compare the whole point at once instead of each coordinate separately.&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>Mon, 12 Sep 2016 10:51:13 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/remove-duplicate-points-from-a-list/m-p/6556507#M128701</guid>
      <dc:creator>martti.halminen</dc:creator>
      <dc:date>2016-09-12T10:51:13Z</dc:date>
    </item>
    <item>
      <title>Re: Remove duplicate points from a list</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/remove-duplicate-points-from-a-list/m-p/6558727#M128702</link>
      <description>&lt;P&gt;Ah yes: CONS v APPEND. One I normally&amp;nbsp;follow. I had APPEND in the original test code to ease comparison between the two lists but neglected to change it to CONS for the final.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks again to all.&lt;/P&gt;</description>
      <pubDate>Tue, 13 Sep 2016 10:20:44 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/remove-duplicate-points-from-a-list/m-p/6558727#M128702</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2016-09-13T10:20:44Z</dc:date>
    </item>
    <item>
      <title>Re : Remove duplicate points from a list</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/remove-duplicate-points-from-a-list/m-p/6559038#M128703</link>
      <description>&lt;P&gt;Appears that Gile's is the fastest of a few tested:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Note that some only remove the 'duplicates'&lt;/P&gt;&lt;P&gt;to the Autocad exactness.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Points: 5000, Duplicated in place: 400&lt;BR /&gt;Remove_Multi: 3.6090E+00, Rem: 4600&lt;BR /&gt;Remove_Doubles: 2.9850E+00, Rem: 4600 [ Gile ]&lt;BR /&gt;PL_RemEqua: 1.1390E+01, Rem: 4600&lt;BR /&gt;L_RemEqu: 1.6203E+01, Rem: 4600&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;; Remove Equals, resolution D, explicit, SCG,etal&lt;BR /&gt;(defun PL_RemEqua ( L D / U Q F V ) ;&lt;BR /&gt;&amp;nbsp;&amp;nbsp; (while (setq P (car L)) (setq L (cdr L) F NIL V U)&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; (while (setq Q (car V)) ; terminate on find,&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; (if (equal P Q D) (setq F T V nil) (setq V (cdr V))) )&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; (if (not F) (setq U (cons P U)))&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; ) (reverse U) ) ; def ~1/3 speed of CADaStroumph, Remove_Multi&lt;/P&gt;</description>
      <pubDate>Tue, 13 Sep 2016 13:14:05 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/remove-duplicate-points-from-a-list/m-p/6559038#M128703</guid>
      <dc:creator>stevor</dc:creator>
      <dc:date>2016-09-13T13:14:05Z</dc:date>
    </item>
    <item>
      <title>Re : Remove duplicate points from a list</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/remove-duplicate-points-from-a-list/m-p/6559383#M128704</link>
      <description>&lt;P&gt;Hi&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The result of benchmark&lt;/P&gt;&lt;P&gt;&lt;EM&gt;Elapsed milliseconds / relative speed for 131072 iteration(s):&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;(REMOVE_DOUBLES TRI_POINTS).....1887 / 1.23 &amp;lt;fastest&amp;gt;&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt;(PATRICK_35 TRI_POINTS).........1904 / 1.22&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt;(KENT1COOPER1 TRI_POINTS).......2168 / 1.07&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt;(KENT1COOPER2 TRI_POINTS).......2215 / 1.05&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt;(REMOVE_MULTI TRI_POINTS).......2278 / 1.02&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt;(THAVASI1982 TRI_POINTS)........2325 / 1 &amp;lt;slowest&amp;gt;&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;An another&lt;/P&gt;&lt;P&gt;&lt;EM&gt;Elapsed milliseconds / relative speed for 131072 iteration(s):&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;(PATRICK_35 TRI_POINTS).........1903 / 1.24 &amp;lt;fastest&amp;gt;&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt;(REMOVE_DOUBLES TRI_POINTS).....1935 / 1.22&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt;(KENT1COOPER1 TRI_POINTS).......2246 / 1.05&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt;(REMOVE_MULTI TRI_POINTS).......2262 / 1.04&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt;(KENT1COOPER2 TRI_POINTS).......2293 / 1.03&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt;(THAVASI1982 TRI_POINTS)........2355 / 1 &amp;lt;slowest&amp;gt;&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;(defun patrick_35(TRI_Points / lst)
  (while TRI_Points
    (setq lst (cons (car TRI_Points) lst)
	  TRI_Points (vl-remove (car TRI_Points) TRI_Points)
    )
  )
  (reverse lst)
)

(defun remove_doubles (lst)
  (if lst
    (cons (car lst) (remove_doubles (vl-remove (car lst) lst)))
  )
)

(defun thavasi1982(TRI_Points / n item TRI_StrippedPoints)
  (setq n 0)
  (repeat (length TRI_Points)
	  (setq item (nth n TRI_Points))
	  (if (not (member item TRI_StrippedPoints))
	    (progn
	      (setq TRI_StrippedPoints (cons item TRI_StrippedPoints))
	    );progn
	  );if
	  (setq n (1+ n))
  )
  TRI_StrippedPoints
)

(defun remove_multi ( l / nw_l )
  (mapcar
    '(lambda (x)
      (if (not (member x nw_l))
        (setq nw_l (cons x nw_l))
      )
    )
    l
  )
  nw_l
)

(defun Kent1Cooper1(TRI_Points / pt TRI_StrippedPoints)
  (foreach pt TRI_Points
    (if (not (member pt TRI_StrippedPoints))
      (setq TRI_StrippedPoints (cons pt TRI_StrippedPoints))
    )
    (reverse TRI_StrippedPoints); [only if necessary]
  )
)

(defun Kent1Cooper2(TRI_Points / pt TRI_StrippedPoints)
  (foreach pt TRI_Points
    (if (not (member pt TRI_StrippedPoints))
      (setq TRI_StrippedPoints (append TRI_StrippedPoints (list pt)))
    )
    TRI_StrippedPoints
  )
)&lt;/PRE&gt;&lt;PRE&gt;(setq TRI_Points '((0.0 0.0 0.0) (0.0 0.0 0.0) (10.0 0.0 0.0) (10.0 0.0 0.0) (0.0 0.0 0.1) (10.0 0.0 0.0)))&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;(benchmark (list '(patrick_35 TRI_Points)
		 '(remove_doubles TRI_Points)
		 '(thavasi1982 TRI_Points)
		 '(remove_multi TRI_Points)
		 '(Kent1Cooper1 TRI_Points)
		 '(Kent1Cooper2 TRI_Points)
	   )
)&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;@+&lt;/P&gt;</description>
      <pubDate>Tue, 13 Sep 2016 15:09:02 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/remove-duplicate-points-from-a-list/m-p/6559383#M128704</guid>
      <dc:creator>patrick_35</dc:creator>
      <dc:date>2016-09-13T15:09:02Z</dc:date>
    </item>
    <item>
      <title>Re : Remove duplicate points from a list</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/remove-duplicate-points-from-a-list/m-p/6561049#M128705</link>
      <description>&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Another trick you can try on performance-critical code: VL-POSITION is clearly faster than MEMBER (or at least it was last time I measured it).&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;- in general code I don't recommend this (unless you are really interested in the position), as it hides the programmer intent.&lt;/P&gt;&lt;P&gt;- This is an implementation error in AutoLISP: as VL-POSITION does more work, it should actually be slower, so the MEMBER implementation is somehow bungled.&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>Wed, 14 Sep 2016 09:08:17 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/remove-duplicate-points-from-a-list/m-p/6561049#M128705</guid>
      <dc:creator>martti.halminen</dc:creator>
      <dc:date>2016-09-14T09:08:17Z</dc:date>
    </item>
    <item>
      <title>Re: Remove duplicate points from a list</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/remove-duplicate-points-from-a-list/m-p/6561390#M128706</link>
      <description>&lt;P&gt;another method:&lt;/P&gt;&lt;PRE&gt;(defun RemoveEqualPts (LstPts fuzz / lstRet)
  (mapcar (function (lambda (pt / )
   (if (not (vl-some (function (lambda (x) (if (equal pt x fuzz) x nil))) lstRet))
    (setq lstRet (cons pt lstRet))
   );c.if
  )) LstPts)
  lstRet
 );c.defun&lt;/PRE&gt;&lt;P&gt;example:&lt;/P&gt;&lt;PRE&gt;(RemoveEqualPts
 '((0.0 0.0 0.0) (0.0 0.0 0.0) (10.0 0.0 0.0) (10.0 0.0 0.0) (0.0 0.0 0.1) (10.0 0.0 0.0)) 
 0.0001
)&lt;/PRE&gt;</description>
      <pubDate>Wed, 14 Sep 2016 12:34:06 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/remove-duplicate-points-from-a-list/m-p/6561390#M128706</guid>
      <dc:creator>joselggalan</dc:creator>
      <dc:date>2016-09-14T12:34:06Z</dc:date>
    </item>
  </channel>
</rss>

