<?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 units of existing lisp in Visual LISP, AutoLISP and General Customization Forum</title>
    <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/change-units-of-existing-lisp/m-p/10490558#M57852</link>
    <description>&lt;P&gt;Thank you Kent! I'm very new at this.&lt;BR /&gt;Do you have any suggestions to start learning code language for be able to read and write lisp? I'm interested. Thank you.&lt;/P&gt;</description>
    <pubDate>Fri, 23 Jul 2021 12:17:59 GMT</pubDate>
    <dc:creator>allebana13</dc:creator>
    <dc:date>2021-07-23T12:17:59Z</dc:date>
    <item>
      <title>Change units of existing lisp</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/change-units-of-existing-lisp/m-p/10488578#M57845</link>
      <description>&lt;P&gt;Hi everyone!&lt;BR /&gt;I have this routine from kimprojects, that sum up length of polylines and label as a text. Works very good but i need to change the units from meters to centimeters and i couldn't do it so far. Any helps?&lt;BR /&gt;&lt;BR /&gt;(defun c:LPL (/ e ss l p i)&lt;BR /&gt;(if&lt;BR /&gt;(setq l 0.0 ss (ssget '((0 . "LINE,SPLINE,LWPOLYLINE,POLYLINE,ARC,CIRCLE,ELLIPSE"))))&lt;BR /&gt;(progn&lt;BR /&gt;(repeat (setq i (sslength ss))&lt;BR /&gt;(setq e (ssname ss (setq i (1- i)))&lt;BR /&gt;l (+ l (vlax-curve-getDistAtParam e (vlax-curve-getEndParam e)))&lt;BR /&gt;)&lt;BR /&gt;)&lt;BR /&gt;(if&lt;BR /&gt;(setq p (getpoint "\nSpecify a point to insert text: "))&lt;BR /&gt;(entmake&lt;BR /&gt;(list&lt;BR /&gt;'(0 . "TEXT")&lt;BR /&gt;'(100 . "AcDbText")&lt;BR /&gt;(cons 10 (trans p 1 0))&lt;BR /&gt;(cons 40 (/ 0.2 (getvar 'cannoscalevalue)))&lt;BR /&gt;(cons 1 (rtos l))&lt;BR /&gt;)&lt;BR /&gt;)&lt;BR /&gt;(princ (strcat "\nTotal length = " (rtos l)))&lt;BR /&gt;)&lt;BR /&gt;)&lt;BR /&gt;)&lt;BR /&gt;(princ)&lt;BR /&gt;)&lt;/P&gt;</description>
      <pubDate>Thu, 22 Jul 2021 17:18:22 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/change-units-of-existing-lisp/m-p/10488578#M57845</guid>
      <dc:creator>allebana13</dc:creator>
      <dc:date>2021-07-22T17:18:22Z</dc:date>
    </item>
    <item>
      <title>Re: Change units of existing lisp</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/change-units-of-existing-lisp/m-p/10488599#M57846</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/3446932"&gt;@allebana13&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;&amp;nbsp;need to change the units from meters to centimeters and i couldn't do it so far. Any helps?&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;Add this line&lt;/P&gt;
&lt;PRE&gt;...
)
&lt;FONT color="#0000FF"&gt;&lt;STRONG&gt;(setq l (* 100 l))&lt;/STRONG&gt;&lt;/FONT&gt;
(if
 (setq p (getpoint "\nSpecify a point to insert text: "))
  (entmake
...
&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 22 Jul 2021 17:29:02 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/change-units-of-existing-lisp/m-p/10488599#M57846</guid>
      <dc:creator>pbejse</dc:creator>
      <dc:date>2021-07-22T17:29:02Z</dc:date>
    </item>
    <item>
      <title>Re: Change units of existing lisp</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/change-units-of-existing-lisp/m-p/10488782#M57847</link>
      <description>&lt;P&gt;Thank you! it works perfectly.&lt;/P&gt;</description>
      <pubDate>Thu, 22 Jul 2021 18:41:56 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/change-units-of-existing-lisp/m-p/10488782#M57847</guid>
      <dc:creator>allebana13</dc:creator>
      <dc:date>2021-07-22T18:41:56Z</dc:date>
    </item>
    <item>
      <title>Re: Change units of existing lisp</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/change-units-of-existing-lisp/m-p/10488809#M57848</link>
      <description>&lt;P&gt;i have another question. How do i set the precision of the unit so that returns a non-decimal number?&lt;BR /&gt;If total lenght is 12.031, i want to get 12 instead.&lt;BR /&gt;Sorry for my bad english, I really appreciate your help.&lt;/P&gt;</description>
      <pubDate>Thu, 22 Jul 2021 18:52:27 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/change-units-of-existing-lisp/m-p/10488809#M57848</guid>
      <dc:creator>allebana13</dc:creator>
      <dc:date>2021-07-22T18:52:27Z</dc:date>
    </item>
    <item>
      <title>Re: Change units of existing lisp</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/change-units-of-existing-lisp/m-p/10488844#M57849</link>
      <description>&lt;P&gt;Change (rtos l ) to (rtos l 2 0 )&lt;/P&gt;</description>
      <pubDate>Thu, 22 Jul 2021 19:06:48 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/change-units-of-existing-lisp/m-p/10488844#M57849</guid>
      <dc:creator>pbejse</dc:creator>
      <dc:date>2021-07-22T19:06:48Z</dc:date>
    </item>
    <item>
      <title>Re: Change units of existing lisp</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/change-units-of-existing-lisp/m-p/10490502#M57850</link>
      <description>&lt;P&gt;Hi! Thank you! I tried this and doesn't work, i keep getting a result with 4 decimal. What can be wrong?&lt;BR /&gt;&lt;BR /&gt;(defun c:LPL (/ e ss l p i)&lt;BR /&gt;(if&lt;BR /&gt;(setq l 0.0 ss (ssget '((0 . "LINE,SPLINE,LWPOLYLINE,POLYLINE,ARC,CIRCLE,ELLIPSE"))))&lt;BR /&gt;(progn&lt;BR /&gt;(repeat (setq i (sslength ss))&lt;BR /&gt;(setq e (ssname ss (setq i (1- i)))&lt;BR /&gt;l (+ l (vlax-curve-getDistAtParam e (vlax-curve-getEndParam e)))&lt;BR /&gt;)&lt;BR /&gt;)&lt;BR /&gt;(setq l (* 100 l))&lt;BR /&gt;(if&lt;BR /&gt;(setq p (getpoint "\nSpecify a point to insert text: "))&lt;BR /&gt;(entmake&lt;BR /&gt;(list&lt;BR /&gt;'(0 . "TEXT")&lt;BR /&gt;'(100 . "AcDbText")&lt;BR /&gt;(cons 10 (trans p 1 0))&lt;BR /&gt;(cons 40 (/ 0.15 (getvar 'cannoscalevalue)))&lt;BR /&gt;(cons 1 (rtos l))&lt;BR /&gt;)&lt;BR /&gt;)&lt;BR /&gt;(princ (strcat "\nTotal length = " (rtos l 2 0)))&lt;BR /&gt;)&lt;BR /&gt;)&lt;BR /&gt;)&lt;BR /&gt;(princ)&lt;BR /&gt;)&lt;/P&gt;</description>
      <pubDate>Fri, 23 Jul 2021 11:55:22 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/change-units-of-existing-lisp/m-p/10490502#M57850</guid>
      <dc:creator>allebana13</dc:creator>
      <dc:date>2021-07-23T11:55:22Z</dc:date>
    </item>
    <item>
      <title>Re: Change units of existing lisp</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/change-units-of-existing-lisp/m-p/10490537#M57851</link>
      <description>&lt;P&gt;You changed the prompt, but not also the part that sets the text content:&lt;/P&gt;
&lt;P&gt;&lt;FONT face="courier new,courier"&gt;&lt;STRONG&gt;&lt;FONT color="#FF0000"&gt;(cons 1 (rtos l))&lt;/FONT&gt;&lt;/STRONG&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;should be&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="courier new,courier" color="#0000FF"&gt;&lt;STRONG&gt;(cons 1 (rtos l 2 0))&lt;/STRONG&gt;&lt;/FONT&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 23 Jul 2021 12:09:17 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/change-units-of-existing-lisp/m-p/10490537#M57851</guid>
      <dc:creator>Kent1Cooper</dc:creator>
      <dc:date>2021-07-23T12:09:17Z</dc:date>
    </item>
    <item>
      <title>Re: Change units of existing lisp</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/change-units-of-existing-lisp/m-p/10490558#M57852</link>
      <description>&lt;P&gt;Thank you Kent! I'm very new at this.&lt;BR /&gt;Do you have any suggestions to start learning code language for be able to read and write lisp? I'm interested. Thank you.&lt;/P&gt;</description>
      <pubDate>Fri, 23 Jul 2021 12:17:59 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/change-units-of-existing-lisp/m-p/10490558#M57852</guid>
      <dc:creator>allebana13</dc:creator>
      <dc:date>2021-07-23T12:17:59Z</dc:date>
    </item>
    <item>
      <title>Re: Change units of existing lisp</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/change-units-of-existing-lisp/m-p/10491203#M57853</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/3446932"&gt;@allebana13&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;....&lt;BR /&gt;Do you have any suggestions to start learning code language for be able to read and write lisp? ....&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;Search this Forum for terms like "learn Lisp" or "learn AutoLisp" or "tutorial" or related wordings, and you will find a lot of suggestions for website links, videos, books, etc.&lt;/P&gt;</description>
      <pubDate>Fri, 23 Jul 2021 16:03:50 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/change-units-of-existing-lisp/m-p/10491203#M57853</guid>
      <dc:creator>Kent1Cooper</dc:creator>
      <dc:date>2021-07-23T16:03:50Z</dc:date>
    </item>
    <item>
      <title>Re: Change units of existing lisp</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/change-units-of-existing-lisp/m-p/12865982#M57854</link>
      <description>&lt;P&gt;Hi everyone, how to change my unit from ' to m in my lisp&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 28 Jun 2024 01:24:19 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/change-units-of-existing-lisp/m-p/12865982#M57854</guid>
      <dc:creator>suarez_residence</dc:creator>
      <dc:date>2024-06-28T01:24:19Z</dc:date>
    </item>
    <item>
      <title>Re: Change units of existing lisp</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/change-units-of-existing-lisp/m-p/12865989#M57855</link>
      <description>&lt;P&gt;(DEFUN CHGD(OS / NS SL CT LT )&lt;BR /&gt;(SETQ NS "" SL (STRLEN OS) CT 1)&lt;BR /&gt;(WHILE (&amp;lt;= CT SL)&lt;BR /&gt;(SETQ LT (SUBSTR OS CT 1))&lt;BR /&gt;(IF (= LT "d")(SETQ LT "%%d"))&lt;BR /&gt;(SETQ CT (1+ CT) NS (STRCAT NS LT))))&lt;/P&gt;&lt;P&gt;(DEFUN C:BEARINGS( / P1 P2 P3 P4 DSTR DIST ASTR ANG TMP ENT LEN SS FLG KW1 TH KW )&lt;BR /&gt;(SETVAR "OSMODE" 0)&lt;BR /&gt;(SETVAR "ANGBASE" 0)&lt;BR /&gt;(SETVAR "CMDECHO" 0)&lt;BR /&gt;(command "style" "" "" 0.0 "" "" "" "" "" nil)&lt;BR /&gt;(PRINC "Note: ALL DISTANCES are from the X-Y PLANE\n")&lt;BR /&gt;(INITGET 1 "LR RL LL RR BL BR DL DR")&lt;BR /&gt;(SETQ KW (GETKWORD "LR RL LL RR BL BR DL DR: "))&lt;BR /&gt;(initget (+ 2 4))&lt;BR /&gt;(SETQ TH (GETDIST (strcat "TEXT HEIGHT &amp;lt;" (rtos (getvar "TEXTSIZE")) "&amp;gt; :")))&lt;BR /&gt;(if (= nil TH)(setq th (getvar "textsize")))&lt;BR /&gt;(INITGET 1 "Yes No")&lt;BR /&gt;(SETQ KW1 (GETKWORD "Reverse the Bearing Direction &amp;lt;Y&amp;gt;es &amp;lt;N&amp;gt;o: "))&lt;BR /&gt;(SETQ FLG 0)&lt;BR /&gt;(if (= KW1 "Yes")(progn&lt;BR /&gt;(IF (and(= KW "LR")(= FLG 0))(SETQ KW "RL" FLG 1))&lt;BR /&gt;(IF (and(= KW "RL")(= FLG 0))(SETQ KW "LR" FLG 1))&lt;BR /&gt;(IF (and(= KW "LL")(= FLG 0))(SETQ KW "RR" FLG 1))&lt;BR /&gt;(IF (and(= KW "RR")(= FLG 0))(SETQ KW "LL" FLG 1))&lt;BR /&gt;(IF (and(= KW "BL")(= FLG 0))(SETQ KW "BR" FLG 1))&lt;BR /&gt;(IF (and(= KW "BR")(= FLG 0))(SETQ KW "BL" FLG 1))&lt;BR /&gt;(IF (and(= KW "DL")(= FLG 0))(SETQ KW "DR" FLG 1))&lt;BR /&gt;(IF (and(= KW "DR")(= FLG 0))(SETQ KW "DL" FLG 1))&lt;BR /&gt;))&lt;BR /&gt;(SETVAR "TEXTSIZE" TH)&lt;BR /&gt;(SETQ SS (SSGET))&lt;BR /&gt;(SETQ LEN (SSLENGTH SS))&lt;BR /&gt;(SETVAR "HIGHLIGHT" 0)&lt;BR /&gt;(PRINC "WORKING...\n")&lt;BR /&gt;(REPEAT LEN&lt;BR /&gt;(SETQ LEN (1- LEN))&lt;BR /&gt;(SETQ ENT (SSNAME SS LEN))&lt;BR /&gt;(IF (/= "LINE" (CDR (ASSOC '0 (ENTGET ENT))))&lt;BR /&gt;(SSDEL ENT SS))&lt;BR /&gt;)&lt;BR /&gt;(SETQ LEN (SSLENGTH SS))&lt;BR /&gt;(REPEAT LEN&lt;BR /&gt;(SETQ LEN (1- LEN)&lt;BR /&gt;ENT (ENTGET (SSNAME SS LEN))&lt;BR /&gt;P1 (CDR (ASSOC '10 ENT))&lt;BR /&gt;P2 (CDR (ASSOC '11 ENT))&lt;BR /&gt;)&lt;BR /&gt;(IF (= KW1 "Yes")(SETQ TMP P2 P2 P1 P1 TMP))&lt;BR /&gt;(SETQ ANG (ANGLE P1 P2)&lt;BR /&gt;ASTR (CHGD (ANGTOS ANG 4 6))&lt;BR /&gt;DIST (DISTANCE P1 P2)&lt;BR /&gt;DSTR (RTOS DIST 2 3)&lt;BR /&gt;DSTR (STRCAT DSTR "\047")&lt;BR /&gt;P3 (POLAR P1 ANG (/ DIST 2.0))&lt;BR /&gt;P3 (POLAR P3 (+ ANG (/ PI 2.0))(* TH 1.125))&lt;BR /&gt;P4 (POLAR P1 ANG (/ DIST 2.0))&lt;BR /&gt;P4 (POLAR P4 (- ANG (/ PI 2.0))(* TH 1.125))&lt;BR /&gt;)&lt;BR /&gt;(IF (AND (&amp;gt; ANG (/ PI 2.0))(&amp;lt; ANG (* PI 1.5)))(SETQ ANG (- ANG PI)))&lt;BR /&gt;(SETQ ANG (ANGTOS ANG 0 8))&lt;BR /&gt;(IF (OR (= KW "DL") (= KW "DR"))(SETQ ASTR ""))&lt;BR /&gt;(IF (OR (= KW "BL")(= KW "BR"))(SETQ DSTR ""))&lt;BR /&gt;(IF (= ASTR "E")(SETQ ASTR "East"))&lt;BR /&gt;(IF (= ASTR "N")(SETQ ASTR "North"))&lt;BR /&gt;(IF (= ASTR "W")(SETQ ASTR "West"))&lt;BR /&gt;(IF (= ASTR "S")(SETQ ASTR "South"))&lt;BR /&gt;(IF (OR (= KW "LR")(= KW "BL")(= KW "DR"))(PROGN&lt;BR /&gt;(COMMAND "TEXT" "M" P3 "" ANG ASTR)&lt;BR /&gt;(COMMAND "TEXT" "M" P4 "" ANG DSTR)&lt;BR /&gt;)&lt;BR /&gt;)&lt;BR /&gt;(IF (= KW "LL") (PROGN&lt;BR /&gt;(SETQ ASTR (STRCAT ASTR " " DSTR))&lt;BR /&gt;(COMMAND "TEXT" "M" P3 "" ANG ASTR)&lt;BR /&gt;)&lt;BR /&gt;)&lt;BR /&gt;(IF (OR (= KW "RL")(= KW "BR")(= KW "DL")) (PROGN&lt;BR /&gt;(COMMAND "TEXT" "M" P4 "" ANG ASTR)&lt;BR /&gt;(COMMAND "TEXT" "M" P3 "" ANG DSTR)&lt;BR /&gt;)&lt;BR /&gt;)&lt;BR /&gt;(IF (= KW "RR") (PROGN&lt;BR /&gt;(SETQ ASTR (STRCAT ASTR " " DSTR))&lt;BR /&gt;(COMMAND "TEXT" "M" P4 "" ANG ASTR)&lt;BR /&gt;)&lt;BR /&gt;)&lt;BR /&gt;)&lt;BR /&gt;(SETVAR "HIGHLIGHT" 1)&lt;BR /&gt;(SETQ SS nil)(GC)&lt;BR /&gt;(SETVAR "FLATLAND" 0)&lt;BR /&gt;(PRINC "DONE")&lt;BR /&gt;(PRINC)&lt;BR /&gt;);close defun&lt;/P&gt;</description>
      <pubDate>Fri, 28 Jun 2024 01:27:33 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/change-units-of-existing-lisp/m-p/12865989#M57855</guid>
      <dc:creator>suarez_residence</dc:creator>
      <dc:date>2024-06-28T01:27:33Z</dc:date>
    </item>
  </channel>
</rss>

