<?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: Change 2d polyline to line in Visual LISP, AutoLISP and General Customization Forum</title>
    <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/change-2d-polyline-to-line/m-p/11708329#M35437</link>
    <description>&lt;P&gt;Dear&amp;nbsp;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/10748013"&gt;@etilley327KA&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Try this code&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="general"&gt;(defun c:test (/ A 1stS 2ndS)
  (setq A (car (entsel)))
  (command "_.explode" A)
  (command "_change" (entlast) "" "p" "e" "0" "")
  (setq
    1stS (vlax-curve-getStartPoint (entlast))
    2ndS (vlax-curve-getEndPoint (entlast))
  )
  (princ 1stS)
  (princ 2ndS)
  (princ)
)&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Thu, 26 Jan 2023 19:29:44 GMT</pubDate>
    <dc:creator>calderg1000</dc:creator>
    <dc:date>2023-01-26T19:29:44Z</dc:date>
    <item>
      <title>Change 2d polyline to line</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/change-2d-polyline-to-line/m-p/11703074#M35426</link>
      <description>&lt;P&gt;What's the simplest way to switch a 2D polyline to a line. I can just explode it usually, but the command in the lisp doesn't seem to work.&lt;/P&gt;</description>
      <pubDate>Tue, 24 Jan 2023 22:32:55 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/change-2d-polyline-to-line/m-p/11703074#M35426</guid>
      <dc:creator>etilley327KA</dc:creator>
      <dc:date>2023-01-24T22:32:55Z</dc:date>
    </item>
    <item>
      <title>Re: Change 2d polyline to line</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/change-2d-polyline-to-line/m-p/11703128#M35427</link>
      <description>EXPLODE command always works.&lt;BR /&gt;&lt;BR /&gt;No idea about your LISP though, you forgot to include it here for us to see what all it is supposed to do.</description>
      <pubDate>Tue, 24 Jan 2023 23:00:50 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/change-2d-polyline-to-line/m-p/11703128#M35427</guid>
      <dc:creator>pendean</dc:creator>
      <dc:date>2023-01-24T23:00:50Z</dc:date>
    </item>
    <item>
      <title>Re: Change 2d polyline to line</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/change-2d-polyline-to-line/m-p/11703146#M35428</link>
      <description>&lt;P&gt;Apologies.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;FONT size="2" color="#0000FF"&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;defun&lt;/SPAN&gt;&lt;SPAN&gt; c:test (/ A 1stS 2ndS)&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;FONT size="2" color="#0000FF"&gt;&lt;SPAN&gt;&amp;nbsp; (&lt;/SPAN&gt;&lt;SPAN&gt;setq&lt;/SPAN&gt;&lt;SPAN&gt; A (&lt;/SPAN&gt;&lt;SPAN&gt;entsel&lt;/SPAN&gt;&lt;SPAN&gt;))&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;FONT size="2" color="#0000FF"&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;command&lt;/SPAN&gt; &lt;SPAN&gt;"_.explode"&lt;/SPAN&gt;&lt;SPAN&gt; A &lt;/SPAN&gt;&lt;SPAN&gt;""&lt;/SPAN&gt;&lt;SPAN&gt;)&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;FONT size="2" color="#0000FF"&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;setq&lt;/SPAN&gt;&lt;SPAN&gt; A (&lt;/SPAN&gt;&lt;SPAN&gt;car&lt;/SPAN&gt;&lt;SPAN&gt; A))&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;FONT size="2" color="#0000FF"&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;command&lt;/SPAN&gt; &lt;SPAN&gt;"_move"&lt;/SPAN&gt;&lt;SPAN&gt; A &lt;/SPAN&gt;&lt;SPAN&gt;""&lt;/SPAN&gt; &lt;SPAN&gt;""&lt;/SPAN&gt; &lt;SPAN&gt;"0,0,0.00"&lt;/SPAN&gt;&lt;SPAN&gt;)&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;FONT size="2" color="#0000FF"&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;setq&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;FONT size="2" color="#0000FF"&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 1stS (&lt;/SPAN&gt;&lt;SPAN&gt;vlax-curve-getStartPoint&lt;/SPAN&gt;&lt;SPAN&gt; A)&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;FONT size="2" color="#0000FF"&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 2ndS (&lt;/SPAN&gt;&lt;SPAN&gt;vlax-curve-getEndPoint&lt;/SPAN&gt;&lt;SPAN&gt; A))&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;FONT size="2" color="#0000FF"&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;princ&lt;/SPAN&gt;&lt;SPAN&gt; 1stS)&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;FONT size="2" color="#0000FF"&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;princ&lt;/SPAN&gt;&lt;SPAN&gt; 2ndS)&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;FONT size="2" color="#0000FF"&gt;&lt;SPAN&gt;)&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/DIV&gt;&lt;/DIV&gt;</description>
      <pubDate>Tue, 24 Jan 2023 23:11:25 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/change-2d-polyline-to-line/m-p/11703146#M35428</guid>
      <dc:creator>etilley327KA</dc:creator>
      <dc:date>2023-01-24T23:11:25Z</dc:date>
    </item>
    <item>
      <title>Re: Change 2d polyline to line</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/change-2d-polyline-to-line/m-p/11703211#M35429</link>
      <description>&lt;P&gt;Regards&amp;nbsp;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/10748013"&gt;@etilley327KA&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Try this code...&lt;/P&gt;&lt;LI-CODE lang="general"&gt;(defun c:xlp (/ s sp ep ln)
  (princ "\nSelect Lwpolyline:")
  (while (null (setq s (ssget "_+.:E:S" '((0 . "lwpolyline")))))
    (princ "\n¡Empty selection or not a valid Lwpolyline!")
  )
  (setq sp (vlax-curve-getstartpoint (ssname s 0))
        ep (vlax-curve-getendpoint (ssname s 0))
        ln (entmakex (list '(0 . "line")
                           (cons 10 sp)
                           (cons 11 ep)
                     )
           )
  )
  (entdel (ssname s 0))
  (princ)
)&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 25 Jan 2023 00:04:29 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/change-2d-polyline-to-line/m-p/11703211#M35429</guid>
      <dc:creator>calderg1000</dc:creator>
      <dc:date>2023-01-25T00:04:29Z</dc:date>
    </item>
    <item>
      <title>Re: Change 2d polyline to line</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/change-2d-polyline-to-line/m-p/11703276#M35430</link>
      <description>&lt;P&gt;Dear&amp;nbsp;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/10748013"&gt;@etilley327KA&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I made some small changes to your code. I don't understand why you move the exploded object to its same location "0.,0.,0"...?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="general"&gt;(defun c:test (/ A 1stS 2ndS)
  (setq A (car (entsel)))
  (command "_.explode" A)
  (setq A (entlast))
  (command "_move" A "" "" "0.,0.,0.")
  (setq
    1stS (vlax-curve-getStartPoint A)
    2ndS (vlax-curve-getEndPoint A)
  )
  (princ 1stS)
  (princ 2ndS)
)&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 25 Jan 2023 00:59:40 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/change-2d-polyline-to-line/m-p/11703276#M35430</guid>
      <dc:creator>calderg1000</dc:creator>
      <dc:date>2023-01-25T00:59:40Z</dc:date>
    </item>
    <item>
      <title>Re: Change 2d polyline to line</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/change-2d-polyline-to-line/m-p/11703441#M35431</link>
      <description>&lt;P&gt;When used in an AutoLisp (command) function, Explode can work on only one object [it surprised me a little that it will accept the &lt;EM&gt;list&lt;/EM&gt; that is in your A variable, and didn't require just the entity name].&amp;nbsp; It doesn't take the Enter "" to complete the selection -- that will only recall your previous command, unwanted.&lt;/P&gt;
&lt;P&gt;But once it has been Exploded, &lt;EM&gt;there is no&lt;/EM&gt; (car A) any more.&lt;/P&gt;</description>
      <pubDate>Wed, 25 Jan 2023 03:28:00 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/change-2d-polyline-to-line/m-p/11703441#M35431</guid>
      <dc:creator>Kent1Cooper</dc:creator>
      <dc:date>2023-01-25T03:28:00Z</dc:date>
    </item>
    <item>
      <title>Re: Change 2d polyline to line</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/change-2d-polyline-to-line/m-p/11703464#M35432</link>
      <description>&lt;P&gt;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/10748013"&gt;@etilley327KA&lt;/a&gt;&amp;nbsp; hi,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Calling "explode" from (command) function has always behave differently e.g it explode only the first selected object and finish.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;; example&lt;/P&gt;&lt;P&gt;(command "explode" "Last")&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;there was no need to end the selection, why is that? Autodesk holds the&amp;nbsp;&amp;nbsp;&lt;SPAN&gt;answer&lt;/SPAN&gt;&amp;nbsp;&lt;span class="lia-unicode-emoji" title=":grinning_face:"&gt;😀&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;to overcome this (and for other command) they gave us (initcommandvertion) function (read on that in online help)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;the following would work.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;enjoy&lt;/P&gt;&lt;P&gt;moshe&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="general"&gt;(defun c:test (/ ss)
 (if (setq ss (ssget))
  (progn
   (initcommandversion 2)
   (command "explode" ss "")
  )
 )
)&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 25 Jan 2023 03:41:08 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/change-2d-polyline-to-line/m-p/11703464#M35432</guid>
      <dc:creator>Moshe-A</dc:creator>
      <dc:date>2023-01-25T03:41:08Z</dc:date>
    </item>
    <item>
      <title>Re: Change 2d polyline to line</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/change-2d-polyline-to-line/m-p/11705371#M35433</link>
      <description>Thanks, so I had to reset the variable after it exploded. I move it to the same location, but moved the elevation to zero.</description>
      <pubDate>Wed, 25 Jan 2023 17:57:54 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/change-2d-polyline-to-line/m-p/11705371#M35433</guid>
      <dc:creator>etilley327KA</dc:creator>
      <dc:date>2023-01-25T17:57:54Z</dc:date>
    </item>
    <item>
      <title>Re: Change 2d polyline to line</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/change-2d-polyline-to-line/m-p/11708093#M35434</link>
      <description>&lt;P&gt;I thought the move command was just adjusting the entity to zero Z, but now ive noticed that it started moving its location (X,Y). How might I adjust this so that it only moves on the Z?&lt;/P&gt;</description>
      <pubDate>Thu, 26 Jan 2023 17:50:29 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/change-2d-polyline-to-line/m-p/11708093#M35434</guid>
      <dc:creator>etilley327KA</dc:creator>
      <dc:date>2023-01-26T17:50:29Z</dc:date>
    </item>
    <item>
      <title>Re: Change 2d polyline to line</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/change-2d-polyline-to-line/m-p/11708120#M35435</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/10748013"&gt;@etilley327KA&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;.... How might I adjust this so that it only moves on the Z?&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;One way:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="general"&gt;(command "_.move" A ""
  (setq p1 (cdr (assoc 10 (entget A)))); from its start point
  (list (car p1) (cadr p1) 0); to the same X &amp;amp; Y, but with Z = 0
)&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You could use 11 instead of 10, to use the end point, if it matters.&amp;nbsp; It should matter only if the Line has unequal Z values for its two ends, but if that's true and you want &lt;EM&gt;both&lt;/EM&gt; ends at Z=0, Move isn't going to do it for you -- there would need to be separate adjustments to the two ends.&lt;/P&gt;</description>
      <pubDate>Thu, 26 Jan 2023 18:08:49 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/change-2d-polyline-to-line/m-p/11708120#M35435</guid>
      <dc:creator>Kent1Cooper</dc:creator>
      <dc:date>2023-01-26T18:08:49Z</dc:date>
    </item>
    <item>
      <title>Re: Change 2d polyline to line</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/change-2d-polyline-to-line/m-p/11708126#M35436</link>
      <description>Thats perfect</description>
      <pubDate>Thu, 26 Jan 2023 18:07:44 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/change-2d-polyline-to-line/m-p/11708126#M35436</guid>
      <dc:creator>etilley327KA</dc:creator>
      <dc:date>2023-01-26T18:07:44Z</dc:date>
    </item>
    <item>
      <title>Re: Change 2d polyline to line</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/change-2d-polyline-to-line/m-p/11708329#M35437</link>
      <description>&lt;P&gt;Dear&amp;nbsp;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/10748013"&gt;@etilley327KA&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Try this code&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="general"&gt;(defun c:test (/ A 1stS 2ndS)
  (setq A (car (entsel)))
  (command "_.explode" A)
  (command "_change" (entlast) "" "p" "e" "0" "")
  (setq
    1stS (vlax-curve-getStartPoint (entlast))
    2ndS (vlax-curve-getEndPoint (entlast))
  )
  (princ 1stS)
  (princ 2ndS)
  (princ)
)&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 26 Jan 2023 19:29:44 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/change-2d-polyline-to-line/m-p/11708329#M35437</guid>
      <dc:creator>calderg1000</dc:creator>
      <dc:date>2023-01-26T19:29:44Z</dc:date>
    </item>
    <item>
      <title>Re: Change 2d polyline to line</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/change-2d-polyline-to-line/m-p/11708340#M35438</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/4920461"&gt;@calderg1000&lt;/a&gt;&amp;nbsp;wrote:&lt;LI-CODE lang="general"&gt;....
  (command "_change" (entlast) "" "p" "e" "0" "")
....&lt;/LI-CODE&gt;&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;That's more concise than using MOVE, &lt;STRONG&gt;&lt;EM&gt;provided&lt;/EM&gt;&lt;/STRONG&gt; the Line in question has equal Z values at both ends, i.e. that it &lt;EM&gt;has&lt;/EM&gt; an "elevation" property to change.&amp;nbsp; It won't work if the Z values differ.&lt;/P&gt;</description>
      <pubDate>Thu, 26 Jan 2023 19:47:11 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/change-2d-polyline-to-line/m-p/11708340#M35438</guid>
      <dc:creator>Kent1Cooper</dc:creator>
      <dc:date>2023-01-26T19:47:11Z</dc:date>
    </item>
    <item>
      <title>Re: Change 2d polyline to line</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/change-2d-polyline-to-line/m-p/11708638#M35439</link>
      <description>&lt;P&gt;Dear&amp;nbsp;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/69526"&gt;@Kent1Cooper&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The request is to exploit a polyline, it is supposed to have a section and with elevation. To obtain a Line, therefore after exploiting its 2 vertices will have the same elevation.&lt;BR /&gt;I think you should specify:&lt;/P&gt;&lt;LI-CODE lang="general"&gt;;...
(setq A (car (entsel"\nSelect Lwpolyline:")))
;...&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 26 Jan 2023 21:44:55 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/change-2d-polyline-to-line/m-p/11708638#M35439</guid>
      <dc:creator>calderg1000</dc:creator>
      <dc:date>2023-01-26T21:44:55Z</dc:date>
    </item>
  </channel>
</rss>

