<?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>idea Windows Environment variables in ModelBuilder in ModelBuilder Ideas</title>
    <link>https://community.esri.com/t5/modelbuilder-ideas/windows-environment-variables-in-modelbuilder/idi-p/939079</link>
    <description>&lt;P&gt;It sure would be great to access Windows environment variables in ModelBuilder as builtin model variables. For example %COMPUTERNAME% %USERNAME% or user defined ones set in the Windows Control Panel or in a startup script. I realize one can do this with Calculate Value calling os.environ["COMPUTERNAME"], but this would be easier.&lt;/P&gt;&lt;P&gt;Way back in the 20th century,&amp;nbsp;in ArcInfo Workstation AML, we could access windows env variables like AML variables with %COMPUTERNAME%. In that environment, if a windows environment variable conflicted with an AML variable, the AML variable would always take precedence to avoid confusion. I think that would be a good way to do it in ModelBuilder too.&lt;/P&gt;&lt;P&gt;A very common use case for me is constructing path names, so for example %TEMP%\%USERNAME%_%t%&lt;/P&gt;</description>
    <pubDate>Fri, 27 Jan 2023 04:38:00 GMT</pubDate>
    <dc:creator>curtvprice</dc:creator>
    <dc:date>2023-01-27T04:38:00Z</dc:date>
    <item>
      <title>Windows Environment variables in ModelBuilder</title>
      <link>https://community.esri.com/t5/modelbuilder-ideas/windows-environment-variables-in-modelbuilder/idi-p/939079</link>
      <description>&lt;P&gt;It sure would be great to access Windows environment variables in ModelBuilder as builtin model variables. For example %COMPUTERNAME% %USERNAME% or user defined ones set in the Windows Control Panel or in a startup script. I realize one can do this with Calculate Value calling os.environ["COMPUTERNAME"], but this would be easier.&lt;/P&gt;&lt;P&gt;Way back in the 20th century,&amp;nbsp;in ArcInfo Workstation AML, we could access windows env variables like AML variables with %COMPUTERNAME%. In that environment, if a windows environment variable conflicted with an AML variable, the AML variable would always take precedence to avoid confusion. I think that would be a good way to do it in ModelBuilder too.&lt;/P&gt;&lt;P&gt;A very common use case for me is constructing path names, so for example %TEMP%\%USERNAME%_%t%&lt;/P&gt;</description>
      <pubDate>Fri, 27 Jan 2023 04:38:00 GMT</pubDate>
      <guid>https://community.esri.com/t5/modelbuilder-ideas/windows-environment-variables-in-modelbuilder/idi-p/939079</guid>
      <dc:creator>curtvprice</dc:creator>
      <dc:date>2023-01-27T04:38:00Z</dc:date>
    </item>
    <item>
      <title>Re: Windows Environment variables in ModelBuilder</title>
      <link>https://community.esri.com/t5/modelbuilder-ideas/windows-environment-variables-in-modelbuilder/idc-p/939080#M27</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks Curtis for this idea!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Please can you share a few more use cases when you would want to use these&amp;nbsp;&lt;SPAN style="background-color: #ffffff;"&gt;Windows environment variables in a model to construct a path instead of using environment variables or data paths directly?&lt;BR /&gt;User profile specific?&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="background-color: #ffffff;"&gt;Thank You!&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 15 Jul 2020 23:26:20 GMT</pubDate>
      <guid>https://community.esri.com/t5/modelbuilder-ideas/windows-environment-variables-in-modelbuilder/idc-p/939080#M27</guid>
      <dc:creator>ShitijMehta</dc:creator>
      <dc:date>2020-07-15T23:26:20Z</dc:date>
    </item>
    <item>
      <title>Re: Windows Environment variables in ModelBuilder</title>
      <link>https://community.esri.com/t5/modelbuilder-ideas/windows-environment-variables-in-modelbuilder/idc-p/939081#M28</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;examples of windows environment variables.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If the variable didn't exist the expected behavior would what is is now when you specify a variable that does not exist, ie you get the literal "%VAR%" unmodified.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Path to create a folder in TEMP for the model to log information:&lt;/P&gt;&lt;P&gt;Create Folder, folder: %TEMP% name:%COMPUTERNAME%_%USERNAME%&lt;/P&gt;&lt;P&gt;Access the 1:24K quads in the ArcMap folder: MakeFeaturesLayer %AGSDESKTOPJAVA%\\Reference Systems\World Time Zones.shp&amp;nbsp; quads&lt;/P&gt;&lt;P&gt;Find out it ArcMap is installed: CalculateValue arcpy.Exists(r"%AGSDESKTOPJAVA%")&lt;/P&gt;&lt;P&gt;Find out if ArcInfo Workstation is installed (haha)&amp;nbsp;&lt;SPAN&gt;CalculateValue arcpy.Exists(r"%ARCHOME%")&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;Write a status info table to %APPDATA%\ESRI folder TableToTable %logtable% %APPDATA%\ESRI\log%t%.dbf&lt;/P&gt;&lt;P&gt;If expression to find out whether we have more than two processors:&amp;nbsp;%NUMBER_OF_PROCESSORS% &amp;gt; 2&lt;/P&gt;&lt;P&gt;Access user defined variable (set by user in control panel) lay, MY_LOGPATH&amp;nbsp; &amp;nbsp;%MY_LOGPATH%&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;To get a quick list of environment variables open a windows cmd window and enter: set&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 16 Jul 2020 13:49:58 GMT</pubDate>
      <guid>https://community.esri.com/t5/modelbuilder-ideas/windows-environment-variables-in-modelbuilder/idc-p/939081#M28</guid>
      <dc:creator>curtvprice</dc:creator>
      <dc:date>2020-07-16T13:49:58Z</dc:date>
    </item>
    <item>
      <title>Re: Windows Environment variables in ModelBuilder</title>
      <link>https://community.esri.com/t5/modelbuilder-ideas/windows-environment-variables-in-modelbuilder/idc-p/1000515#M30</link>
      <description>&lt;P&gt;It occurred to me that it's pretty easy to get these with an arcpy method, so maybe it's a matter of documenting this functionality for use with Calculate Value:&lt;/P&gt;&lt;PRE&gt;&lt;FONT face="lucida sans unicode,lucida sans" size="2"&gt;Executing (Calculate Value): CalculateValue arcpy.GetSystemEnvironment("AGSDESKTOPJAVA") # Variant&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="lucida sans unicode,lucida sans" size="2"&gt;Start Time: Wednesday, November 11, 2020 8:18:36 PM&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="lucida sans unicode,lucida sans" size="2"&gt;Value = C:\Program Files (x86)\ArcGIS\Desktop10.7\&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="lucida sans unicode,lucida sans" size="2"&gt;Succeeded at Wednesday, November 11, 2020 8:18:36 PM (Elapsed Time: 0.00 seconds)&lt;/FONT&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 12 Nov 2020 03:20:22 GMT</pubDate>
      <guid>https://community.esri.com/t5/modelbuilder-ideas/windows-environment-variables-in-modelbuilder/idc-p/1000515#M30</guid>
      <dc:creator>curtvprice</dc:creator>
      <dc:date>2020-11-12T03:20:22Z</dc:date>
    </item>
    <item>
      <title>Re: Windows Environment variables in ModelBuilder</title>
      <link>https://community.esri.com/t5/modelbuilder-ideas/windows-environment-variables-in-modelbuilder/idc-p/1225094#M31</link>
      <description>&lt;P&gt;I also would like this feature to be integrated to the "normal" GP tool dialog! This would be a great thing for example to get dynamic parameter values for geoprocessing tools configured in tasks steps in ArcGIS Pro.&lt;/P&gt;</description>
      <pubDate>Tue, 25 Oct 2022 09:59:09 GMT</pubDate>
      <guid>https://community.esri.com/t5/modelbuilder-ideas/windows-environment-variables-in-modelbuilder/idc-p/1225094#M31</guid>
      <dc:creator>ChristophKoschmieder</dc:creator>
      <dc:date>2022-10-25T09:59:09Z</dc:date>
    </item>
  </channel>
</rss>

