<?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: Draw poiyline using a list containing X, Y coordinate in Visual LISP, AutoLISP and General Customization Forum</title>
    <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/draw-poiyline-using-a-list-containing-x-y-coordinate/m-p/7562859#M111902</link>
    <description>&lt;P&gt;But then you need a tripify function, or maybe trioify for heavies or 3Ds.&lt;/P&gt;</description>
    <pubDate>Tue, 21 Nov 2017 18:40:36 GMT</pubDate>
    <dc:creator>john.uhden</dc:creator>
    <dc:date>2017-11-21T18:40:36Z</dc:date>
    <item>
      <title>Draw poiyline using a list containing X, Y coordinate</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/draw-poiyline-using-a-list-containing-x-y-coordinate/m-p/7556229#M111895</link>
      <description>&lt;P&gt;Hello, all. I am a beginner of AutoCAD lisp.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have two simple questions&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;1. I generate a list which containing X Y coordinate such as:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Coor = (100 10 101 12 103 32)&lt;/P&gt;&lt;P&gt;which means X1 = 100, Y1 = 10, X2 = 101, Y2 = 12, X3 = 103, Y3 = 32.&lt;/P&gt;&lt;P&gt;Here, how can I make lisp code to work as like:&lt;/P&gt;&lt;P&gt;(COMMAND "PLINE" "100,10" "101,12" "103,32" "")&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;2. Through the web search, I understand there are several methods to draw pline from the list as like:&lt;/P&gt;&lt;P&gt;Coor_1 = ((100 10) (101 12) (103 32))&lt;/P&gt;&lt;P&gt;Here, how can I change the list format from Coor (original one in above #1) to Coor_1?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you. Cheers,&lt;/P&gt;</description>
      <pubDate>Sun, 19 Nov 2017 12:27:14 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/draw-poiyline-using-a-list-containing-x-y-coordinate/m-p/7556229#M111895</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2017-11-19T12:27:14Z</dc:date>
    </item>
    <item>
      <title>Re: Draw poiyline using a list containing X, Y coordinate</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/draw-poiyline-using-a-list-containing-x-y-coordinate/m-p/7556344#M111896</link>
      <description>&lt;P&gt;I've find the solution by myself. Thanks.&lt;/P&gt;</description>
      <pubDate>Sun, 19 Nov 2017 14:48:34 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/draw-poiyline-using-a-list-containing-x-y-coordinate/m-p/7556344#M111896</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2017-11-19T14:48:34Z</dc:date>
    </item>
    <item>
      <title>Re: Draw poiyline using a list containing X, Y coordinate</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/draw-poiyline-using-a-list-containing-x-y-coordinate/m-p/7556963#M111897</link>
      <description>&lt;P&gt;Can you post the solution to share with other searching ???&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thanks&lt;BR /&gt;Discussion_Admin&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 20 Nov 2017 00:30:05 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/draw-poiyline-using-a-list-containing-x-y-coordinate/m-p/7556963#M111897</guid>
      <dc:creator>Discussion_Admin</dc:creator>
      <dc:date>2017-11-20T00:30:05Z</dc:date>
    </item>
    <item>
      <title>Re: Draw poiyline using a list containing X, Y coordinate</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/draw-poiyline-using-a-list-containing-x-y-coordinate/m-p/7556988#M111898</link>
      <description>&lt;P&gt;Just to perhaps confirm what you found, Coor is called a flat list (x1 y1 x2 y2 xn yn) whereas Coor_1 is a 2D list (a list of 2D points).&lt;/P&gt;
&lt;P&gt;The flat list is what you need if you want to use (vla-addlightweighrpolyline ...).&lt;/P&gt;
&lt;P&gt;The 2D list is handy if you want to use (command ".pline" (mapcar Coor_1) "")&lt;/P&gt;
&lt;P&gt;The 2D list can be converted into a flat list by (apply 'append Coor_1).&lt;/P&gt;
&lt;P&gt;The flat list can be converted into a 2D list by grouping the list in pairs...&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&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;BR /&gt;&lt;BR /&gt;Such as (@group Coor 2)&lt;BR /&gt;which can also be used for 3D flat lists, as in&lt;BR /&gt;(@group flatlist 3)&lt;/PRE&gt;</description>
      <pubDate>Mon, 20 Nov 2017 00:52:24 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/draw-poiyline-using-a-list-containing-x-y-coordinate/m-p/7556988#M111898</guid>
      <dc:creator>john.uhden</dc:creator>
      <dc:date>2017-11-20T00:52:24Z</dc:date>
    </item>
    <item>
      <title>Re: Draw poiyline using a list containing X, Y coordinate</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/draw-poiyline-using-a-list-containing-x-y-coordinate/m-p/7558531#M111899</link>
      <description>&lt;P&gt;This can actually be a lot simpler than you might think.&amp;nbsp; The 'Coordinates VLA Property of a LWPolyline is just such a "flat list," and can be imposed on a Polyline, &lt;EM&gt;even one without the same number of vertices&lt;/EM&gt;.&amp;nbsp; The coordinates do need to be &lt;FONT color="#ff0000"&gt;real numbers&lt;/FONT&gt;, though, not integers.&amp;nbsp; The following &lt;FONT color="#ff0000"&gt;makes that conversion&lt;/FONT&gt;, and &lt;FONT color="#008000"&gt;draws a temporary minimal Polyline&lt;/FONT&gt;, then &lt;FONT color="#ff00ff"&gt;imposes those coordinates&lt;FONT color="#000000"&gt; on it&lt;/FONT&gt;&lt;/FONT&gt;.&amp;nbsp; The &lt;FONT color="#3366ff"&gt;PLINETYPE System Variable needs to be other than 0&lt;/FONT&gt;, because a "heavy" Polyline needs XY&lt;EM&gt;&lt;STRONG&gt;Z&lt;/STRONG&gt;&lt;/EM&gt; coordinates, not just XY.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#999999"&gt;(vl-load-com); if not already loaded&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#3366ff"&gt;(setvar 'plinetype 2)&lt;/FONT&gt;&lt;FONT color="#999999"&gt;; in case it happens to be 0&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;(setq Coor &lt;FONT color="#ff0000"&gt;(mapcar 'float Coor)&lt;/FONT&gt;)&lt;BR /&gt;&lt;FONT color="#008000"&gt;(command "_.pline" (getvar 'viewctr) "@1,0" "")&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT color="#ff00ff"&gt;(vlax-put (vlax-ename-&amp;gt;vla-object (entlast)) 'Coordinates Coor)&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#000000"&gt;This has an additional benefit over any approach that breaks up the list into point lists and uses them in a PLINE &lt;EM&gt;command&lt;/EM&gt;, that this doesn't require any accounting for whether any Object Snap modes are running.&lt;/FONT&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 20 Nov 2017 14:11:09 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/draw-poiyline-using-a-list-containing-x-y-coordinate/m-p/7558531#M111899</guid>
      <dc:creator>Kent1Cooper</dc:creator>
      <dc:date>2017-11-20T14:11:09Z</dc:date>
    </item>
    <item>
      <title>Re: Draw poiyline using a list containing X, Y coordinate</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/draw-poiyline-using-a-list-containing-x-y-coordinate/m-p/7559913#M111900</link>
      <description>&lt;P&gt;Excellent!&amp;nbsp; That's actually the way I usually do it, though sometimes I will use entmake because I can include the desired layer name without any additional code, plus plinewid and closed.&amp;nbsp; Actually, entmake followed by putting the coordinates is probably the best and easiest.&amp;nbsp; The last step is to setbulge.&lt;/P&gt;</description>
      <pubDate>Mon, 20 Nov 2017 20:22:37 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/draw-poiyline-using-a-list-containing-x-y-coordinate/m-p/7559913#M111900</guid>
      <dc:creator>john.uhden</dc:creator>
      <dc:date>2017-11-20T20:22:37Z</dc:date>
    </item>
    <item>
      <title>Re: Draw poiyline using a list containing X, Y coordinate</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/draw-poiyline-using-a-list-containing-x-y-coordinate/m-p/7561130#M111901</link>
      <description>&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Another way to make a 2D list:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;(defun pairify (l)
  ;; (a b c d...) -&amp;gt; ((a b)(c d) ...)
  (cond ((null l) nil)
        (T (cons (list (car l) (cadr l)) (pairify (cddr l))))))&lt;/PRE&gt;
&lt;P&gt;--&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 21 Nov 2017 08:59:23 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/draw-poiyline-using-a-list-containing-x-y-coordinate/m-p/7561130#M111901</guid>
      <dc:creator>martti.halminen</dc:creator>
      <dc:date>2017-11-21T08:59:23Z</dc:date>
    </item>
    <item>
      <title>Re: Draw poiyline using a list containing X, Y coordinate</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/draw-poiyline-using-a-list-containing-x-y-coordinate/m-p/7562859#M111902</link>
      <description>&lt;P&gt;But then you need a tripify function, or maybe trioify for heavies or 3Ds.&lt;/P&gt;</description>
      <pubDate>Tue, 21 Nov 2017 18:40:36 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/draw-poiyline-using-a-list-containing-x-y-coordinate/m-p/7562859#M111902</guid>
      <dc:creator>john.uhden</dc:creator>
      <dc:date>2017-11-21T18:40:36Z</dc:date>
    </item>
    <item>
      <title>Re: Draw poiyline using a list containing X, Y coordinate</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/draw-poiyline-using-a-list-containing-x-y-coordinate/m-p/7562915#M111903</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;arz6oiof wrote:...........&lt;BR /&gt;
&lt;P&gt;Coor = (100 10 101 12 103 32)&lt;/P&gt;
&lt;P&gt;....&lt;/P&gt;
&lt;P&gt;Here, how can I make lisp code to work as like:&lt;/P&gt;
&lt;P&gt;(COMMAND "PLINE" "100,10" "101,12" "103,32" "")&lt;/P&gt;
&lt;P&gt;...........&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;There can be many possible ways as suggested above by other members. Here is one example&lt;/P&gt;
&lt;PRE&gt;Command: (setq Coor '(100 10 101 12 103 32))
(100 10 101 12 103 32)
Command: (mapcar '(lambda (x y) (list x y)) Coor (cdr Coor))
((100 10) (10 101) (101 12) (12 103) (103 32))&lt;/PRE&gt;
&lt;P&gt;To make a pline from this list,
&lt;PRE&gt;(apply 'command (append '("._pline") (mapcar '(lambda (x y) (list x y)) Coor (cdr Coor)) '("")))&lt;/PRE&gt;
&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="2d_point_list.gif" style="width: 705px;"&gt;&lt;img src="https://forums.autodesk.com/t5/image/serverpage/image-id/429331i4E3C653AB7BD933B/image-size/large?v=v2&amp;amp;px=999" role="button" title="2d_point_list.gif" alt="2d_point_list.gif" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 21 Nov 2017 18:55:36 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/draw-poiyline-using-a-list-containing-x-y-coordinate/m-p/7562915#M111903</guid>
      <dc:creator>Ranjit_Singh</dc:creator>
      <dc:date>2017-11-21T18:55:36Z</dc:date>
    </item>
    <item>
      <title>Re: Draw poiyline using a list containing X, Y coordinate</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/draw-poiyline-using-a-list-containing-x-y-coordinate/m-p/7563581#M111904</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/3261555"&gt;@Ranjit_Singh&lt;/a&gt; wrote:&lt;BR /&gt;
&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;There can be many possible ways as suggested above by other members. Here is one example&lt;/P&gt;
&lt;PRE&gt;Command: (setq Coor '(100 10 101 12 103 32))
(100 10 101 12 103 32)
Command: (mapcar '(lambda (x y) (list x y)) Coor (cdr Coor))
((100 10) (10 101) (101 12) (12 103) (103 32))&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;Ranjit, your list has 5 vertexes, not 3, like it should be (= list_length / 2), so it is not the same polyline.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 21 Nov 2017 22:48:24 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/draw-poiyline-using-a-list-containing-x-y-coordinate/m-p/7563581#M111904</guid>
      <dc:creator>phanaem</dc:creator>
      <dc:date>2017-11-21T22:48:24Z</dc:date>
    </item>
    <item>
      <title>Re: Draw poiyline using a list containing X, Y coordinate</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/draw-poiyline-using-a-list-containing-x-y-coordinate/m-p/7563617#M111905</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;
&lt;BLOCKQUOTE&gt;phanaem&amp;nbsp;wrote:...&lt;BR /&gt;Ranjit, your list has 5 vertexes, not 3, like it should be (= list_length / 2), so it is not the same polyline...&amp;nbsp;&lt;/BLOCKQUOTE&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;Thanks for the correction. I have adjusted my code&lt;/P&gt;
&lt;PRE&gt;(setq Coor '(100 10 101 12 103 32) ctr 1)&lt;BR /&gt;(apply 'command&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; (append '("._pline")&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; (vl-remove nil&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; (mapcar '(lambda (x y)&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; (if (minusp (setq ctr (- ctr)))&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; (list x y)))&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; coor&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; (cdr coor)))&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; '("")))
&lt;/PRE&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="2d_point_list_correct.gif" style="width: 705px;"&gt;&lt;img src="https://forums.autodesk.com/t5/image/serverpage/image-id/429458i8C41E30FE1E9CAEF/image-size/large?v=v2&amp;amp;px=999" role="button" title="2d_point_list_correct.gif" alt="2d_point_list_correct.gif" /&gt;&lt;/span&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 21 Nov 2017 23:26:53 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/draw-poiyline-using-a-list-containing-x-y-coordinate/m-p/7563617#M111905</guid>
      <dc:creator>Ranjit_Singh</dc:creator>
      <dc:date>2017-11-21T23:26:53Z</dc:date>
    </item>
    <item>
      <title>Re: Draw poiyline using a list containing X, Y coordinate</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/draw-poiyline-using-a-list-containing-x-y-coordinate/m-p/7564275#M111906</link>
      <description>&lt;P&gt;Just for fun and info.&lt;/P&gt;&lt;P&gt;Lee Mac has written two nice short solutions to convert number lists to 2D or 3D point lists.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;(defun LM:lst-&amp;gt;3DPoint ( l ) ;; © Lee Mac 2010
   (if
      l
      (cons (list (car l) (cadr l) (caddr l)) (LM:lst-&amp;gt;3DPoint (cdddr l)))
   )
)

(defun LM:lst-&amp;gt;2DPoint ( l ) ;; © Lee Mac 2010
   (if
      l
      (cons (list (car l) (cadr l)) (LM:lst-&amp;gt;2DPoint (cddr l)))
   )
)&lt;/PRE&gt;</description>
      <pubDate>Wed, 22 Nov 2017 07:44:40 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/draw-poiyline-using-a-list-containing-x-y-coordinate/m-p/7564275#M111906</guid>
      <dc:creator>DannyNL</dc:creator>
      <dc:date>2017-11-22T07:44:40Z</dc:date>
    </item>
    <item>
      <title>Re: Draw poiyline using a list containing X, Y coordinate</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/draw-poiyline-using-a-list-containing-x-y-coordinate/m-p/7564947#M111907</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/3144455"&gt;@DannyNL&lt;/a&gt; wrote:&lt;BR /&gt;
&lt;P&gt;Just for fun and info.&lt;/P&gt;
&lt;P&gt;Lee Mac has written two nice short solutions to convert number lists to 2D or 3D point lists.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;/BLOCKQUOTE&gt;
&lt;P&gt;Not sure if Lee Mac should be credited for these functions. Even in this topic there is a similar one.&lt;/P&gt;
&lt;P&gt;He could write them from scratch, I know I did, but I guess so did many others, way before us.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If the speed matters, here is an alternative, 5 times faster (tested on 2000 points polyline)&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;(defun list-&amp;gt;2Dpoints (l / a b r)
  (foreach b l
    (cond
      (a (setq r (cons (list a b) r) a nil))
      (T (setq a b))
    )
  )
  (reverse r)
)


(defun list-&amp;gt;3Dpoints (l / a b c r)
  (foreach c l
    (cond
      (b (setq r (cons (list a b c) r) a nil b nil))
      (a (setq b c))
      (T (setq a c))
    )
  )
  (reverse r)
)&lt;/PRE&gt;</description>
      <pubDate>Wed, 22 Nov 2017 12:24:22 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/draw-poiyline-using-a-list-containing-x-y-coordinate/m-p/7564947#M111907</guid>
      <dc:creator>phanaem</dc:creator>
      <dc:date>2017-11-22T12:24:22Z</dc:date>
    </item>
    <item>
      <title>Re: Draw poiyline using a list containing X, Y coordinate</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/draw-poiyline-using-a-list-containing-x-y-coordinate/m-p/7565036#M111908</link>
      <description>&lt;P&gt;Yep, that would be another way. There are multiple way to achieve the same.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Although these functions are pretty straightforward and could be written by anyone with average LISP knowledge, the code examples I posted were written by Lee Mac. I just copied and pasted, so I think it is more than fair to mention credit him since I didn't write them myself.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;And since I do not work very often with lists that contain over 100 points, they are more than sufficient for my needs. In my case I'm not interested in faster if that means a difference of a couple of milliseconds&amp;nbsp;&lt;img id="smileyhappy" class="emoticon emoticon-smileyhappy" src="https://forums.autodesk.com/i/smilies/16x16_smiley-happy.png" alt="Smiley Happy" title="Smiley Happy" /&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 22 Nov 2017 13:01:14 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/draw-poiyline-using-a-list-containing-x-y-coordinate/m-p/7565036#M111908</guid>
      <dc:creator>DannyNL</dc:creator>
      <dc:date>2017-11-22T13:01:14Z</dc:date>
    </item>
    <item>
      <title>Re: Draw poiyline using a list containing X, Y coordinate</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/draw-poiyline-using-a-list-containing-x-y-coordinate/m-p/7565763#M111909</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/3144455"&gt;@DannyNL&lt;/a&gt; wrote:&lt;BR /&gt;
&lt;P&gt;Yep, that would be another way. There are multiple way to achieve the same.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Although these functions are pretty straightforward and could be written by anyone with average LISP knowledge, the code examples I posted were written by Lee Mac. I just copied and pasted, so I think it is more than fair to mention credit him since I didn't write them myself.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;And since I do not work very often with lists that contain over 100 points, they are more than sufficient for my needs. In my case I'm not interested in faster if that means a difference of a couple of milliseconds&amp;nbsp;&lt;img id="smileyhappy" class="emoticon emoticon-smileyhappy" src="https://forums.autodesk.com/i/smilies/16x16_smiley-happy.png" alt="Smiley Happy" title="Smiley Happy" /&gt;&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;Fair enough.&lt;BR /&gt;&lt;BR /&gt;For the sake of truth, the posted lisp is not 5 times faster, it's less than 2. The test I did wasn't accurate.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 22 Nov 2017 16:27:17 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/draw-poiyline-using-a-list-containing-x-y-coordinate/m-p/7565763#M111909</guid>
      <dc:creator>phanaem</dc:creator>
      <dc:date>2017-11-22T16:27:17Z</dc:date>
    </item>
  </channel>
</rss>

