<?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: Getstring with var to .... in Visual LISP, AutoLISP and General Customization Forum</title>
    <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/getstring-with-var-to/m-p/9140659#M81900</link>
    <description>&lt;P&gt;&lt;SPAN class="tlid-translation translation"&gt;&lt;SPAN&gt;I have a new problem I want to read the Untis to remember and later reset.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;(defun c: test ()&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Conversion units and note&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;(setq lu (getvar "Lunits"))&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;(setq lp (getvar "luprec"))&lt;/SPAN&gt;&lt;BR /&gt;&lt;FONT face="arial black,avant garde"&gt;&lt;SPAN&gt;(setq au (getvar "aunits"))&lt;/SPAN&gt;&lt;/FONT&gt;&lt;BR /&gt;&lt;SPAN&gt;(setq ap (getvar "auprec"))&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;(command "units" "2" 0 "1" 0 "0.00" "no")&lt;/SPAN&gt;&lt;BR /&gt;&amp;nbsp;&amp;nbsp; &lt;SPAN&gt;(command "_GRAPHSCR")&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;(command "units" lu lp au ap "0.00" "no")&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;)&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN class=""&gt;The problem is auntis with getvar you get 0-4 but you can only set 1-5?&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;</description>
    <pubDate>Tue, 12 Nov 2019 06:24:23 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2019-11-12T06:24:23Z</dc:date>
    <item>
      <title>Getstring with var to ....</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/getstring-with-var-to/m-p/9138768#M81895</link>
      <description>&lt;P&gt;&lt;SPAN class="tlid-translation translation"&gt;&lt;SPAN&gt;Hello everyone,&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN class=""&gt;I have these lines in a Lisp&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class="tlid-translation translation"&gt;&lt;SPAN class=""&gt;(setq eh (getstring "\nText Einheit [Meter = m; Zentimeter = cm; Millimeter = mm]: ")&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN class="tlid-translation translation"&gt;&lt;SPAN class=""&gt;and I would like to say that if someone enter m the value have to be 1 at &lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN class="tlid-translation translation"&gt;&lt;SPAN class=""&gt;cm 100 at mm 1000 is possible this?&lt;BR /&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN class="tlid-translation translation"&gt;&lt;SPAN class=""&gt;Thanks&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 11 Nov 2019 09:22:40 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/getstring-with-var-to/m-p/9138768#M81895</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2019-11-11T09:22:40Z</dc:date>
    </item>
    <item>
      <title>Re: Getstring with var to ....</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/getstring-with-var-to/m-p/9138821#M81896</link>
      <description>&lt;P&gt;We have worked on this this in &lt;A href="https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/i-can-not-find-a-mistake/m-p/9132491#M392210" target="_blank" rel="noopener"&gt;https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/i-can-not-find-a-mistake/m-p/9132491#M392210&lt;/A&gt;&amp;nbsp; Don't open new posts if not necesary.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;after &lt;SPAN class="tlid-translation translation"&gt;&lt;SPAN class=""&gt;(setq eh (getstring "\nText Einheit [Meter = m; Zentimeter = cm; Millimeter = mm]: ")&lt;/SPAN&gt;&lt;/SPAN&gt;)&lt;/P&gt;&lt;P&gt;put this and you will have value r set to asked value&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;(setq eh (strcase eh T))
(cond ((= eh "m") (setq r 1))((= eh "m") (setq r 1))((= eh "cm") (setq r 100))((= eh "mm") (setq r 1000)))&lt;/PRE&gt;</description>
      <pubDate>Mon, 11 Nov 2019 09:40:45 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/getstring-with-var-to/m-p/9138821#M81896</guid>
      <dc:creator>hak_vz</dc:creator>
      <dc:date>2019-11-11T09:40:45Z</dc:date>
    </item>
    <item>
      <title>Re: Getstring with var to ....</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/getstring-with-var-to/m-p/9138841#M81897</link>
      <description>&lt;P&gt;&lt;SPAN class="tlid-translation translation"&gt;&lt;SPAN&gt;thanks&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN class=""&gt;Next time I make no new post, sorry.&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 11 Nov 2019 09:50:10 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/getstring-with-var-to/m-p/9138841#M81897</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2019-11-11T09:50:10Z</dc:date>
    </item>
    <item>
      <title>Re: Getstring with var to ....</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/getstring-with-var-to/m-p/9138867#M81898</link>
      <description>&lt;P&gt;It's not a problem but it's easyer to follow.&lt;/P&gt;</description>
      <pubDate>Mon, 11 Nov 2019 10:01:12 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/getstring-with-var-to/m-p/9138867#M81898</guid>
      <dc:creator>hak_vz</dc:creator>
      <dc:date>2019-11-11T10:01:12Z</dc:date>
    </item>
    <item>
      <title>Re: Getstring with var to ....</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/getstring-with-var-to/m-p/9138905#M81899</link>
      <description>&lt;P&gt;To be correct&lt;/P&gt;&lt;PRE&gt;(setq eh (strcase eh T))
(cond
	((= eh "m") (setq r 1))
	((= eh "cm") (setq r 100))
	((= eh "mm") (setq r 1000))
)&lt;/PRE&gt;</description>
      <pubDate>Mon, 11 Nov 2019 10:27:36 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/getstring-with-var-to/m-p/9138905#M81899</guid>
      <dc:creator>hak_vz</dc:creator>
      <dc:date>2019-11-11T10:27:36Z</dc:date>
    </item>
    <item>
      <title>Re: Getstring with var to ....</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/getstring-with-var-to/m-p/9140659#M81900</link>
      <description>&lt;P&gt;&lt;SPAN class="tlid-translation translation"&gt;&lt;SPAN&gt;I have a new problem I want to read the Untis to remember and later reset.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;(defun c: test ()&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Conversion units and note&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;(setq lu (getvar "Lunits"))&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;(setq lp (getvar "luprec"))&lt;/SPAN&gt;&lt;BR /&gt;&lt;FONT face="arial black,avant garde"&gt;&lt;SPAN&gt;(setq au (getvar "aunits"))&lt;/SPAN&gt;&lt;/FONT&gt;&lt;BR /&gt;&lt;SPAN&gt;(setq ap (getvar "auprec"))&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;(command "units" "2" 0 "1" 0 "0.00" "no")&lt;/SPAN&gt;&lt;BR /&gt;&amp;nbsp;&amp;nbsp; &lt;SPAN&gt;(command "_GRAPHSCR")&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;(command "units" lu lp au ap "0.00" "no")&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;)&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN class=""&gt;The problem is auntis with getvar you get 0-4 but you can only set 1-5?&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 12 Nov 2019 06:24:23 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/getstring-with-var-to/m-p/9140659#M81900</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2019-11-12T06:24:23Z</dc:date>
    </item>
    <item>
      <title>Re: Getstring with var to ....</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/getstring-with-var-to/m-p/9140665#M81901</link>
      <description>&lt;P&gt;&lt;A href="https://knowledge.autodesk.com/support/autocad-lt/learn-explore/caas/CloudHelp/cloudhelp/2019/ENU/AutoCAD-LT/files/GUID-C7C0F6A5-7982-43DB-97F9-5B9B0044E9FA-htm.html" target="_blank" rel="noopener"&gt;https://knowledge.autodesk.com/support/autocad-lt/learn-explore/caas/CloudHelp/cloudhelp/2019/ENU/AutoCAD-LT/files/GUID-C7C0F6A5-7982-43DB-97F9-5B9B0044E9FA-htm.html&lt;/A&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;There are functions "getvar" and "setvar".&lt;/P&gt;&lt;P&gt;Variable aunits can have value 0 - 4&amp;nbsp; (5 values).&amp;nbsp;&lt;/P&gt;&lt;P&gt;When you want to change all this variables by using&amp;nbsp; "command" that invokes "units" autocad command then those values expected in units command are&amp;nbsp; 1 - 5.&lt;/P&gt;&lt;P&gt;So, if you use units command add 1 to value received by getvar.&lt;/P&gt;&lt;P&gt;I hope it's clear.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Digression. Counting in autolisp starts with 0.&amp;nbsp; If you have (setq a (list 1 2 3 4)) abd want to take first element in a list by using&amp;nbsp; nth aulolisp command you write (nth 0 a) and receive 1.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;If let say getvar receive value 2 and you don't want to change it then (setvar "variable" 2) or don't even bother with it.&lt;/P&gt;</description>
      <pubDate>Tue, 12 Nov 2019 06:59:23 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/getstring-with-var-to/m-p/9140665#M81901</guid>
      <dc:creator>hak_vz</dc:creator>
      <dc:date>2019-11-12T06:59:23Z</dc:date>
    </item>
    <item>
      <title>Re: Getstring with var to ....</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/getstring-with-var-to/m-p/9140818#M81902</link>
      <description>&lt;P&gt;Sorry, I don't get it real. Iunderstand what You mean with setvar and getvar. Can i say (setq au (getvar "aunits")) and (setvar "aunits" au) ?&lt;/P&gt;&lt;P&gt;I have read about (nth) but how can I get it in my command?&lt;BR /&gt;Exampel (setq farben'("rot" "grün" "blau" "gelb"))&lt;BR /&gt;(nth 2 farben) = blau&lt;/P&gt;</description>
      <pubDate>Tue, 12 Nov 2019 08:28:44 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/getstring-with-var-to/m-p/9140818#M81902</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2019-11-12T08:28:44Z</dc:date>
    </item>
    <item>
      <title>Re: Getstring with var to ....</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/getstring-with-var-to/m-p/9140843#M81903</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;@Anonymous&amp;nbsp; schrieb:&lt;BR /&gt;
&lt;P&gt;Can i say (setq au (getvar "aunits")) and (setvar "aunits" au) ?&lt;/P&gt;
&lt;P&gt;For usual yes, why not? You get the variable-value, you set the variable-value&lt;/P&gt;
&lt;P&gt;The problem vefore was: You habdle with two different things: One Command and one Systemvariables.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I have read about (nth) but how can I get it in my command?&lt;BR /&gt;Exampel (setq farben'("rot" "grün" "blau" "gelb"))&lt;BR /&gt;(nth 2 farben) = blau&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The Question is WHY??&lt;/P&gt;
&lt;P&gt;(nth au farben)&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 12 Nov 2019 08:44:13 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/getstring-with-var-to/m-p/9140843#M81903</guid>
      <dc:creator>cadffm</dc:creator>
      <dc:date>2019-11-12T08:44:13Z</dc:date>
    </item>
    <item>
      <title>Re: Getstring with var to ....</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/getstring-with-var-to/m-p/9142990#M81904</link>
      <description>&lt;P&gt;Like this change snaps and angles it can be easier if using lisp and point variables to do angles in radians.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;(defun c:xxx ..........
(setq oldsnap (getvar 'osmode))
(setvar 'osmode 512)
(setq oldaunits (getvar 'aunits))
(setvar 'aunit 3) ; radians
…
….
(setvar 'osmode oldnsap) ; reset back
(setvar 'aunits oldaunits)
(princ)
)&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 13 Nov 2019 03:44:45 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/getstring-with-var-to/m-p/9142990#M81904</guid>
      <dc:creator>Sea-Haven</dc:creator>
      <dc:date>2019-11-13T03:44:45Z</dc:date>
    </item>
    <item>
      <title>Re: Getstring with var to ....</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/getstring-with-var-to/m-p/9142993#M81905</link>
      <description>&lt;P&gt;This is a can only pick dcl, its a library routine can be used in any code just save Multi radio buttons.lsp to a search path location or add path.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;(if (not AH:Butts)(load "Multi Radio buttons.lsp"))
(if (= but nil)(setq but 1))
(setq eh (ah:butts but "v"  '("m or mm or cm" "m" "cm" "mm")))

(cond
	((= eh "m") (setq r 1))
	((= eh "cm") (setq r 100))
	((= eh "mm") (setq r 1000))
)&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;See screenshot&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 13 Nov 2019 03:55:23 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/getstring-with-var-to/m-p/9142993#M81905</guid>
      <dc:creator>Sea-Haven</dc:creator>
      <dc:date>2019-11-13T03:55:23Z</dc:date>
    </item>
    <item>
      <title>Re: Getstring with var to ....</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/getstring-with-var-to/m-p/9143097#M81906</link>
      <description>&lt;P&gt;&lt;SPAN class="tlid-translation translation"&gt;&lt;SPAN&gt;Thanks.&lt;/SPAN&gt; &lt;SPAN&gt;Regarding Units that was exactly what I was looking for.&lt;/SPAN&gt; &lt;SPAN&gt;The input is very ingenious.&lt;/SPAN&gt; &lt;SPAN&gt;Can I extend this?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN class=""&gt;;Query&lt;/SPAN&gt;&lt;BR /&gt;&amp;nbsp;&amp;nbsp; &lt;SPAN class=""&gt;(initget (+ 1 2 4))&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN class=""&gt;(setq ma (getreal "\ nscale [1:50 = 50]:"))&lt;/SPAN&gt;&lt;BR /&gt;&amp;nbsp;&amp;nbsp; &lt;SPAN&gt;(initget (+ 1 2 4))&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;(setq th (getreal "\ nText height [2.5 = 25]:"))&lt;/SPAN&gt;&lt;BR /&gt;&amp;nbsp;&amp;nbsp; &lt;SPAN class=""&gt;(initget (+ 1 4))&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN class=""&gt;(setq ks (getreal "\ nText Komastellen [0-8]:"))&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 13 Nov 2019 06:14:07 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/getstring-with-var-to/m-p/9143097#M81906</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2019-11-13T06:14:07Z</dc:date>
    </item>
  </channel>
</rss>

