<?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: SETENV and GETENV Equivalents in AutoCAD in AutoCAD Forum</title>
    <link>https://forums.autodesk.com/t5/autocad-forum/setenv-and-getenv-equivalents-in-autocad/m-p/7056832#M228804</link>
    <description>&lt;P&gt;We have been using LT for so long, we have absolutely no experience using LISP since we had no use for it. Everything has been done with command line macros. I have a strong feeling that 99% of the issues that I am going to run into with this migration could be resolved if I redo everything with LISP; however, completely redoing 15 years worth of macros is something I am desperately trying to avoid. I will take a look at the examples that you gave me to get an idea of how painful converting these macros to LISP actually is.&lt;/P&gt;</description>
    <pubDate>Tue, 02 May 2017 21:28:05 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2017-05-02T21:28:05Z</dc:date>
    <item>
      <title>SETENV and GETENV Equivalents in AutoCAD</title>
      <link>https://forums.autodesk.com/t5/autocad-forum/setenv-and-getenv-equivalents-in-autocad/m-p/7056553#M228800</link>
      <description>&lt;P&gt;My firm has been using AutoCAD LT 2012 but a few stations are moving to the full version of AutoCAD 2017/2018 so we are trying to move all of the custom features from LT2012 to CAD2017/18. We have several blocks that we have made macros for so that we can insert them and they are automatically scaled based on the scale we have the drawing set at. To set this scale we have another macro that uses SETENV to create a variable and set the value based on the scale (1/8"=1, 1/4"=0.5, 1/2"=0.25, etc.). The blocks that are created are created so that in a 1/8"=1' drawing, they do not have to be scaled. This allows us to have the block insertion macro to scale all the blocks by the value we saved in that previous variable. (Hopefully all that makes sense).&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The problem we have now is that it looks like SETENV and GETENV are no longer valid commands in AutoCAD. Is there a similar command that I could use?&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 02 May 2017 19:47:37 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/autocad-forum/setenv-and-getenv-equivalents-in-autocad/m-p/7056553#M228800</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2017-05-02T19:47:37Z</dc:date>
    </item>
    <item>
      <title>Re: SETENV and GETENV Equivalents in AutoCAD</title>
      <link>https://forums.autodesk.com/t5/autocad-forum/setenv-and-getenv-equivalents-in-autocad/m-p/7056611#M228801</link>
      <description>&lt;P&gt;They may not be available as&amp;nbsp;&lt;EM&gt;commands&lt;/EM&gt;, but they &lt;EM&gt;are&lt;/EM&gt; as AutoLisp functions --&amp;nbsp;(&lt;STRONG&gt;setenv&lt;/STRONG&gt;) and (&lt;STRONG&gt;getenv&lt;/STRONG&gt;).&amp;nbsp; A&amp;nbsp;few of examples of their use are in some routines I did that store multiple&amp;nbsp;User-specifiable&amp;nbsp;&lt;A href="http://cadtips.cadalyst.com/2d-editing/multiple-fillet-radius-values" target="_self"&gt;Fillet radii&lt;/A&gt; and &lt;A href="http://cadtips.cadalyst.com/2d-operations/multiple-shortcuts-saved-chamfer-distance-values" target="_self"&gt;Chamfer distances&lt;/A&gt; and &lt;A href="http://cadtips.cadalyst.com/2d-editing/save-and-reuse-multiple-offset-distance-values" target="_self"&gt;Offset Distances&lt;/A&gt;.&lt;/P&gt;</description>
      <pubDate>Tue, 02 May 2017 20:19:34 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/autocad-forum/setenv-and-getenv-equivalents-in-autocad/m-p/7056611#M228801</guid>
      <dc:creator>Kent1Cooper</dc:creator>
      <dc:date>2017-05-02T20:19:34Z</dc:date>
    </item>
    <item>
      <title>Re: SETENV and GETENV Equivalents in AutoCAD</title>
      <link>https://forums.autodesk.com/t5/autocad-forum/setenv-and-getenv-equivalents-in-autocad/m-p/7056785#M228802</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;@Anonymous wrote:&lt;BR /&gt;
&lt;P&gt;My firm has been using AutoCAD LT 2012 but a few stations are moving to the full version of AutoCAD 2017/2018 so we are trying to move all of the custom features from LT2012 to CAD2017/18. We have several blocks that we have made macros for so that we can insert them and they are automatically scaled based on the scale we have the drawing set at. To set this scale we have another macro that uses SETENV to create a variable and set the value based on the scale (1/8"=1, 1/4"=0.5, 1/2"=0.25, etc.). The blocks that are created are created so that in a 1/8"=1' drawing, they do not have to be scaled. This allows us to have the block insertion macro to scale all the blocks by the value we saved in that previous variable. (Hopefully all that makes sense).&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The problem we have now is that it looks like SETENV and GETENV are no longer valid commands in AutoCAD. Is there a similar command that I could use?&amp;nbsp;&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;DIMSCALE is the setvar that would control that scale, and in the macro you'd use (getvar to get the dimscale as in (getvar "dimscale")&lt;/P&gt;</description>
      <pubDate>Tue, 02 May 2017 21:10:57 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/autocad-forum/setenv-and-getenv-equivalents-in-autocad/m-p/7056785#M228802</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2017-05-02T21:10:57Z</dc:date>
    </item>
    <item>
      <title>Re: SETENV and GETENV Equivalents in AutoCAD</title>
      <link>https://forums.autodesk.com/t5/autocad-forum/setenv-and-getenv-equivalents-in-autocad/m-p/7056814#M228803</link>
      <description>&lt;P&gt;Either I don't understand your suggestion or you are misunderstanding what I am doing. When we are working on a plan at 1/8"=1' scale, we have a 1/8" Macro that uses SETVAR to set a variable to the value of 1. Then we insert a block (again using a macro). That macro automatically adjusts the scale of the block by a factor of the variable we originally set (using getvar). Again, assuming 1/8" drawing scale, the block insertion macro would scale the block by a factor of 1. If we use our scale macro for a 1/4"=1' scale, the variable is set to 0.5. When using the block inserting macro, that block is automatically adjusted by a factor of 0.5, so that is is half the size of the original block.&lt;/P&gt;</description>
      <pubDate>Tue, 02 May 2017 21:21:11 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/autocad-forum/setenv-and-getenv-equivalents-in-autocad/m-p/7056814#M228803</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2017-05-02T21:21:11Z</dc:date>
    </item>
    <item>
      <title>Re: SETENV and GETENV Equivalents in AutoCAD</title>
      <link>https://forums.autodesk.com/t5/autocad-forum/setenv-and-getenv-equivalents-in-autocad/m-p/7056832#M228804</link>
      <description>&lt;P&gt;We have been using LT for so long, we have absolutely no experience using LISP since we had no use for it. Everything has been done with command line macros. I have a strong feeling that 99% of the issues that I am going to run into with this migration could be resolved if I redo everything with LISP; however, completely redoing 15 years worth of macros is something I am desperately trying to avoid. I will take a look at the examples that you gave me to get an idea of how painful converting these macros to LISP actually is.&lt;/P&gt;</description>
      <pubDate>Tue, 02 May 2017 21:28:05 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/autocad-forum/setenv-and-getenv-equivalents-in-autocad/m-p/7056832#M228804</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2017-05-02T21:28:05Z</dc:date>
    </item>
    <item>
      <title>Re: SETENV and GETENV Equivalents in AutoCAD</title>
      <link>https://forums.autodesk.com/t5/autocad-forum/setenv-and-getenv-equivalents-in-autocad/m-p/7056835#M228805</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/69526"&gt;@Kent1Cooper&lt;/a&gt; wrote:&lt;BR /&gt;&lt;P&gt;They may not be available as&amp;nbsp;&lt;EM&gt;commands&lt;/EM&gt;, but they &lt;EM&gt;are&lt;/EM&gt; as AutoLisp functions --&amp;nbsp;(&lt;STRONG&gt;setenv&lt;/STRONG&gt;) and (&lt;STRONG&gt;getenv&lt;/STRONG&gt;).&amp;nbsp; A&amp;nbsp;few of examples of their use are in some routines I did that store multiple&amp;nbsp;User-specifiable&amp;nbsp;&lt;A href="http://cadtips.cadalyst.com/2d-editing/multiple-fillet-radius-values" target="_self"&gt;Fillet radii&lt;/A&gt; and &lt;A href="http://cadtips.cadalyst.com/2d-operations/multiple-shortcuts-saved-chamfer-distance-values" target="_self"&gt;Chamfer distances&lt;/A&gt; and &lt;A href="http://cadtips.cadalyst.com/2d-editing/save-and-reuse-multiple-offset-distance-values" target="_self"&gt;Offset Distances&lt;/A&gt;.&lt;/P&gt;&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;&lt;SPAN&gt;We have been using LT for so long, we have absolutely no experience using LISP since we had no use for it. Everything has been done with command line macros. I have a strong feeling that 99% of the issues that I am going to run into with this migration could be resolved if I redo everything with LISP; however, completely redoing 15 years worth of macros is something I am desperately trying to avoid. I will take a look at the examples that you gave me to get an idea of how painful converting these macros to LISP actually is.&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 02 May 2017 21:29:07 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/autocad-forum/setenv-and-getenv-equivalents-in-autocad/m-p/7056835#M228805</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2017-05-02T21:29:07Z</dc:date>
    </item>
    <item>
      <title>Re: SETENV and GETENV Equivalents in AutoCAD</title>
      <link>https://forums.autodesk.com/t5/autocad-forum/setenv-and-getenv-equivalents-in-autocad/m-p/7056843#M228806</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;@Anonymous wrote:&lt;/BLOCKQUOTE&gt;&lt;BLOCKQUOTE&gt;&lt;P&gt;DIMSCALE is the setvar that would control that scale, and in the macro you'd use (getvar to get the dimscale as in (getvar "dimscale")&lt;/P&gt;&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;&lt;SPAN&gt;Either I don't understand your suggestion or you are misunderstanding what I am doing. When we are working on a plan at 1/8"=1' scale, we have a 1/8" Macro that uses SETENV to set a variable to the value of 1. Then we insert a block (again using a macro). That macro automatically adjusts the scale of the block by a factor of the variable we originally set (using GETENV&lt;/SPAN&gt;&lt;SPAN&gt;). Again, assuming 1/8" drawing scale, the block insertion macro would scale the block by a factor of 1. If we use our scale macro for a 1/4"=1' scale, the variable is set to 0.5. When using the block inserting macro, that block is automatically adjusted by a factor of 0.5, so that is is half the size of the original block.&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 02 May 2017 21:31:25 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/autocad-forum/setenv-and-getenv-equivalents-in-autocad/m-p/7056843#M228806</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2017-05-02T21:31:25Z</dc:date>
    </item>
    <item>
      <title>Re: SETENV and GETENV Equivalents in AutoCAD</title>
      <link>https://forums.autodesk.com/t5/autocad-forum/setenv-and-getenv-equivalents-in-autocad/m-p/7056875#M228807</link>
      <description>&lt;P&gt;AutoCAD LT doesn't use lisp, so they added a few controls (GETENV, SETENV, etc.) to allow macros to work while pulling environment variables. &amp;nbsp;Full Auto CD has lisp/vlisp and has no need for the extra functions as they are accessed via lisp &amp;nbsp;(getvar and (setvar and MANY more tools. &amp;nbsp;Full AutoCAD opens up a whole new world in customization.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;instead of SETENV, use (setvar "dimscale" 96), then instead of GETENV use (getvar "dimscale") to set the insertion scale. The parens are required.&lt;/P&gt;</description>
      <pubDate>Tue, 02 May 2017 21:44:11 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/autocad-forum/setenv-and-getenv-equivalents-in-autocad/m-p/7056875#M228807</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2017-05-02T21:44:11Z</dc:date>
    </item>
    <item>
      <title>Re: SETENV and GETENV Equivalents in AutoCAD</title>
      <link>https://forums.autodesk.com/t5/autocad-forum/setenv-and-getenv-equivalents-in-autocad/m-p/7056894#M228808</link>
      <description>&lt;P&gt;Odds are lisp function replacement for your macros already exist. &amp;nbsp;Check out the lisp forum &lt;A href="https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/bd-p/130" target="_self"&gt;here &lt;/A&gt;or &lt;A href="https://www.theswamp.org/index.php" target="_self"&gt;theSwamp&lt;/A&gt;&amp;nbsp;or &lt;A href="http://www.lee-mac.com/tutorials.html#vlide" target="_self"&gt;LeeMac&lt;/A&gt;.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;A href="http://www.lee-mac.com/tutorials.html#vlide" target="_self"&gt;LeeMac&lt;/A&gt;&amp;nbsp;also has a series of tutorials on lisp that are excellent.&lt;/P&gt;</description>
      <pubDate>Tue, 02 May 2017 21:49:11 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/autocad-forum/setenv-and-getenv-equivalents-in-autocad/m-p/7056894#M228808</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2017-05-02T21:49:11Z</dc:date>
    </item>
    <item>
      <title>Re: SETENV and GETENV Equivalents in AutoCAD</title>
      <link>https://forums.autodesk.com/t5/autocad-forum/setenv-and-getenv-equivalents-in-autocad/m-p/7056963#M228809</link>
      <description>There are three items that come into mind...&lt;BR /&gt;&lt;BR /&gt;Setting the scale factor is as easy as setting one of the USER keys&lt;BR /&gt;then accessing that key for the scale factor. If you are using a Integer,&lt;BR /&gt;set one of the USERI1 thru USERI5.&lt;BR /&gt;(getvar "USERI1")&lt;BR /&gt;Look into USERR1 (Reals) for decimal format of saved information.&lt;BR /&gt;Also available are the USERS1 thru USERS5 (Strings - however these&lt;BR /&gt;are not saved in the DWG file).&lt;BR /&gt;Downside is these user keys were originally designed for DIESEL&lt;BR /&gt;display of the users' custom variables. They can easily be overwritten&lt;BR /&gt;by another 3rd party program (BTDT).&lt;BR /&gt;&lt;BR /&gt;Next, if what you are saving is file specific, look into VLAX-LDATA-PUT.&lt;BR /&gt;This is a dictionary item that can store user information inside the file.&lt;BR /&gt;&lt;BR /&gt;If what you are saving is NOT file specific, look into VL-REGISTRY-WRITE.&lt;BR /&gt;These are registry items. Commonly used for user settings such as&lt;BR /&gt;OSMODE.&lt;BR /&gt;&lt;BR /&gt;Obsolete method is SETCFG / GETCFG. The registry method has replaced&lt;BR /&gt;these items (INI structured external file)&lt;BR /&gt;&lt;BR /&gt;As rculp suggested, most of us agree that using DIMSCALE as the&lt;BR /&gt;basis of a scale factor is the preferred method. For example, DIMSCALE&lt;BR /&gt;divided by 12.0 gives us our "regular" text height.&lt;BR /&gt;&lt;BR /&gt;???&lt;BR /&gt;</description>
      <pubDate>Tue, 02 May 2017 22:33:08 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/autocad-forum/setenv-and-getenv-equivalents-in-autocad/m-p/7056963#M228809</guid>
      <dc:creator>scot-65</dc:creator>
      <dc:date>2017-05-02T22:33:08Z</dc:date>
    </item>
    <item>
      <title>Re: SETENV and GETENV Equivalents in AutoCAD</title>
      <link>https://forums.autodesk.com/t5/autocad-forum/setenv-and-getenv-equivalents-in-autocad/m-p/7056978#M228810</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;@Anonymous wrote:&lt;BR /&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;instead of SETENV, use (setvar "dimscale" 96), then instead of GETENV use (getvar "dimscale") to set the insertion scale. The parens are required.&lt;/P&gt;&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;Ahh... I understand now. I was trying to write a script in CUI using what you mentioned above. When it comes time to ask for the scale of the drawings I had: (/ (getvar "dimscale") 96) so that it would divide the value of dimscale by 96 to get the 1 or 0.5 that I would need to scale the block by. When I do this manually stepping through the commands line by line it works fine but in the script it looks like AutoCAD is removing the quotes around dimscale. Is there something I am missing here?&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="CUI Capture.JPG" style="width: 279px;"&gt;&lt;img src="https://forums.autodesk.com/t5/image/serverpage/image-id/351789i073601035C6C1390/image-size/large?v=v2&amp;amp;px=999" role="button" title="CUI Capture.JPG" alt="CUI Capture.JPG" /&gt;&lt;/span&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Command Line Capture.JPG" style="width: 474px;"&gt;&lt;img src="https://forums.autodesk.com/t5/image/serverpage/image-id/351790iBA13972A235B81AB/image-size/large?v=v2&amp;amp;px=999" role="button" title="Command Line Capture.JPG" alt="Command Line Capture.JPG" /&gt;&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 02 May 2017 22:42:33 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/autocad-forum/setenv-and-getenv-equivalents-in-autocad/m-p/7056978#M228810</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2017-05-02T22:42:33Z</dc:date>
    </item>
    <item>
      <title>Re: SETENV and GETENV Equivalents in AutoCAD</title>
      <link>https://forums.autodesk.com/t5/autocad-forum/setenv-and-getenv-equivalents-in-autocad/m-p/7057965#M228811</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;tnealey wrote:.&lt;/BLOCKQUOTE&gt;
&lt;BLOCKQUOTE&gt;
&lt;P&gt;...in the script it looks like AutoCAD is removing the quotes around dimscale. Is there something I am missing here?&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;That is odd, but if it has anything to do with the use of double-quotes in a macro, there's an alternative.&amp;nbsp; System variables can be&amp;nbsp;addressed with an &lt;FONT color="#ff0000"&gt;apostrophe before&lt;/FONT&gt; the name [&lt;EM&gt;only&lt;/EM&gt; before], rather than &lt;EM&gt;double&lt;/EM&gt;-quotes at &lt;EM&gt;both&lt;/EM&gt; ends:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;(/ (getvar &lt;FONT color="#ff0000" size="3"&gt;&lt;STRONG&gt;'&lt;/STRONG&gt;&lt;/FONT&gt;dimscale) 96)&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;See whether that makes it work.&amp;nbsp; But it might be simply that not all AutoLisp functions can be used in macros, though I've never seen a breakdown of which can and which can't.&lt;/P&gt;</description>
      <pubDate>Wed, 03 May 2017 11:56:22 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/autocad-forum/setenv-and-getenv-equivalents-in-autocad/m-p/7057965#M228811</guid>
      <dc:creator>Kent1Cooper</dc:creator>
      <dc:date>2017-05-03T11:56:22Z</dc:date>
    </item>
    <item>
      <title>Re: SETENV and GETENV Equivalents in AutoCAD</title>
      <link>https://forums.autodesk.com/t5/autocad-forum/setenv-and-getenv-equivalents-in-autocad/m-p/7058058#M228812</link>
      <description>&lt;P&gt;Works perfectly with the apostrophe. Thanks for the help!!&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 03 May 2017 12:26:39 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/autocad-forum/setenv-and-getenv-equivalents-in-autocad/m-p/7058058#M228812</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2017-05-03T12:26:39Z</dc:date>
    </item>
  </channel>
</rss>

