<?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: Acpy &amp;quot;if&amp;quot;, &amp;quot;elif&amp;quot;, and &amp;quot;else&amp;quot; statement (ArcGIS Pro) in Python Questions</title>
    <link>https://community.esri.com/t5/python-questions/acpy-quot-if-quot-quot-elif-quot-and-quot-else/m-p/664967#M51637</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You had better get &lt;A href="http://pro.arcgis.com/en/pro-app/arcpy/mapping/layer-class.htm"&gt;&lt;STRONG&gt;a list of layers&lt;/STRONG&gt;&lt;/A&gt; and if the lyrx files reside on disk, then you will have to provide the paths to them.&amp;nbsp; I think your 'if' statement comes later, I would examine the code examples in the help topic I highlighted.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 05 Dec 2017 15:47:51 GMT</pubDate>
    <dc:creator>DanPatterson_Retired</dc:creator>
    <dc:date>2017-12-05T15:47:51Z</dc:date>
    <item>
      <title>Acpy "if", "elif", and "else" statement (ArcGIS Pro)</title>
      <link>https://community.esri.com/t5/python-questions/acpy-quot-if-quot-quot-elif-quot-and-quot-else/m-p/664965#M51635</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I have a table in my geodatabase that has urgent care patient visits listed by market. I'm trying to develop a script that will select a certain lyrx based on what market the patient visit took place in. From the research I've done, it looks like&amp;nbsp;the&lt;SPAN style="color: #000000;"&gt;&amp;nbsp;"if", "elif", and "else" statements would accomplish what I'm trying to do.&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #000000;"&gt;I'm thinking it would something like this:&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;DIV class="" style="background: none white !important; border: 0px !important; font-size: 14px; margin: 0px !important; padding: 0px 1em !important;"&gt;&lt;CODE class="" style="color: #006699 !important; background: none !important; border: 0px !important; font-weight: bold !important; font-size: 1em !important; margin: 0px !important; padding: 0px !important;"&gt;if&lt;/CODE&gt; Market_ID&lt;CODE class="" style="color: black !important; background: none !important; border: 0px !important; font-weight: normal !important; font-size: 1em !important; margin: 0px !important; padding: 0px !important;"&gt;&amp;nbsp;&lt;/CODE&gt;&lt;CODE class="" style="color: #006699 !important; background: none !important; border: 0px !important; font-weight: bold !important; font-size: 1em !important; margin: 0px !important; padding: 0px !important;"&gt;=&lt;/CODE&gt;&lt;CODE class="" style="color: #006699 !important; background: none !important; border: 0px !important; font-weight: bold !important; font-size: 1em !important; margin: 0px !important; padding: 0px !important;"&gt;=&lt;/CODE&gt; &lt;CODE class="" style="color: blue !important; background: none !important; border: 0px !important; font-weight: normal !important; font-size: 1em !important; margin: 0px !important; padding: 0px !important;"&gt;"1000"&lt;/CODE&gt;&lt;CODE class="" style="color: black !important; background: none !important; border: 0px !important; font-weight: normal !important; font-size: 1em !important; margin: 0px !important; padding: 0px !important;"&gt;:&lt;/CODE&gt;&lt;/DIV&gt;&lt;DIV class="" style="background: none white !important; border: 0px !important; font-size: 14px; margin: 0px !important; padding: 0px 1em !important;"&gt;&lt;CODE class="" style="background: none !important; border: 0px !important; font-weight: normal !important; font-size: 1em !important; margin: 0px !important; padding: 0px !important;"&gt;&amp;nbsp; &amp;nbsp; &lt;STRONG&gt;print&lt;/STRONG&gt;&lt;/CODE&gt;&amp;nbsp;&lt;CODE class="" style="color: blue !important; background: none !important; border: 0px !important; font-weight: normal !important; font-size: 1em !important; margin: 0px !important; padding: 0px !important;"&gt;"NY_ZipCodes"&lt;/CODE&gt;&lt;/DIV&gt;&lt;DIV class="" style="background: none white !important; border: 0px !important; font-size: 14px; margin: 0px !important; padding: 0px 1em !important;"&gt;&lt;CODE class="" style="color: #006699 !important; background: none !important; border: 0px !important; font-weight: bold !important; font-size: 1em !important; margin: 0px !important; padding: 0px !important;"&gt;elif&lt;/CODE&gt; Market_ID&lt;CODE class="" style="color: black !important; background: none !important; border: 0px !important; font-weight: normal !important; font-size: 1em !important; margin: 0px !important; padding: 0px !important;"&gt;&amp;nbsp;&lt;/CODE&gt;&lt;CODE class="" style="color: #006699 !important; background: none !important; border: 0px !important; font-weight: bold !important; font-size: 1em !important; margin: 0px !important; padding: 0px !important;"&gt;=&lt;/CODE&gt;&lt;CODE class="" style="color: #006699 !important; background: none !important; border: 0px !important; font-weight: bold !important; font-size: 1em !important; margin: 0px !important; padding: 0px !important;"&gt;=&lt;/CODE&gt; &lt;CODE class="" style="color: blue !important; background: none !important; border: 0px !important; font-weight: normal !important; font-size: 1em !important; margin: 0px !important; padding: 0px !important;"&gt;"2000"&lt;/CODE&gt;&lt;CODE class="" style="color: black !important; background: none !important; border: 0px !important; font-weight: normal !important; font-size: 1em !important; margin: 0px !important; padding: 0px !important;"&gt;:&lt;/CODE&gt;&lt;/DIV&gt;&lt;DIV class="" style="background: none white !important; border: 0px !important; font-size: 14px; margin: 0px !important; padding: 0px 1em !important;"&gt;&lt;CODE class="" style="background: none !important; border: 0px !important; font-weight: normal !important; font-size: 1em !important; margin: 0px !important; padding: 0px !important;"&gt;&amp;nbsp; &amp;nbsp; &lt;STRONG&gt;print&lt;/STRONG&gt;&lt;/CODE&gt;&amp;nbsp;&lt;CODE class="" style="color: blue !important; background: none !important; border: 0px !important; font-weight: normal !important; font-size: 1em !important; margin: 0px !important; padding: 0px !important;"&gt;"CT_ZipCodes"&lt;/CODE&gt;&lt;/DIV&gt;&lt;DIV class="" style="background: none white !important; border: 0px !important; font-size: 14px; margin: 0px !important; padding: 0px 1em !important;"&gt;&lt;CODE class="" style="color: #006699 !important; background: none !important; border: 0px !important; font-weight: bold !important; font-size: 1em !important; margin: 0px !important; padding: 0px !important;"&gt;elif&lt;/CODE&gt; Market_ID&lt;CODE class="" style="color: black !important; background: none !important; border: 0px !important; font-weight: normal !important; font-size: 1em !important; margin: 0px !important; padding: 0px !important;"&gt;&amp;nbsp;&lt;/CODE&gt;&lt;CODE class="" style="color: #006699 !important; background: none !important; border: 0px !important; font-weight: bold !important; font-size: 1em !important; margin: 0px !important; padding: 0px !important;"&gt;=&lt;/CODE&gt;&lt;CODE class="" style="color: #006699 !important; background: none !important; border: 0px !important; font-weight: bold !important; font-size: 1em !important; margin: 0px !important; padding: 0px !important;"&gt;=&lt;/CODE&gt; &lt;CODE class="" style="color: blue !important; background: none !important; border: 0px !important; font-weight: normal !important; font-size: 1em !important; margin: 0px !important; padding: 0px !important;"&gt;"3000"&lt;/CODE&gt;&lt;CODE class="" style="color: black !important; background: none !important; border: 0px !important; font-weight: normal !important; font-size: 1em !important; margin: 0px !important; padding: 0px !important;"&gt;:&lt;/CODE&gt;&lt;/DIV&gt;&lt;DIV class="" style="background: none white !important; border: 0px !important; font-size: 14px; margin: 0px !important; padding: 0px 1em !important;"&gt;&lt;CODE class="" style="background: none !important; border: 0px !important; font-weight: normal !important; font-size: 1em !important; margin: 0px !important; padding: 0px !important;"&gt;&amp;nbsp; &amp;nbsp; &lt;STRONG&gt;print&lt;/STRONG&gt;&lt;/CODE&gt;&amp;nbsp;&lt;CODE class="" style="color: blue !important; background: none !important; border: 0px !important; font-weight: normal !important; font-size: 1em !important; margin: 0px !important; padding: 0px !important;"&gt;"CA_ZipCodes"&lt;/CODE&gt;&lt;/DIV&gt;&lt;DIV class="" style="background: none white !important; border: 0px !important; font-size: 14px; margin: 0px !important; padding: 0px 1em !important;"&gt;&lt;CODE class="" style="color: #006699 !important; background: none !important; border: 0px !important; font-weight: bold !important; font-size: 1em !important; margin: 0px !important; padding: 0px !important;"&gt;&lt;/CODE&gt;&lt;/DIV&gt;&lt;DIV class="" style="background: none white !important; border: 0px !important; font-size: 14px; margin: 0px !important; padding: 0px 1em !important;"&gt;&lt;CODE class="" style="color: #006699 !important; background: none !important; border: 0px !important; font-weight: bold !important; font-size: 1em !important; margin: 0px !important; padding: 0px !important;"&gt;else&lt;/CODE&gt;&lt;CODE class="" style="color: black !important; background: none !important; border: 0px !important; font-weight: normal !important; font-size: 1em !important; margin: 0px !important; padding: 0px !important;"&gt;:&lt;/CODE&gt;&lt;/DIV&gt;&lt;DIV class="" style="background: none white !important; border: 0px !important; font-size: 14px; margin: 0px !important; padding: 0px 1em !important;"&gt;&lt;CODE class="" style="background: none !important; border: 0px !important; font-weight: normal !important; font-size: 1em !important; margin: 0px !important; padding: 0px !important;"&gt;&amp;nbsp; &amp;nbsp; &lt;STRONG&gt;print&lt;/STRONG&gt;&lt;/CODE&gt;&amp;nbsp;&lt;CODE class="" style="color: blue !important; background: none !important; border: 0px !important; font-weight: normal !important; font-size: 1em !important; margin: 0px !important; padding: 0px !important;"&gt;"This program has an error"&lt;/CODE&gt;&lt;/DIV&gt;&lt;DIV class="" style="background: none white !important; border: 0px !important; font-size: 14px; margin: 0px !important; padding: 0px 1em !important;"&gt;&lt;CODE class="" style="color: blue !important; background: none !important; border: 0px !important; font-weight: normal !important; font-size: 1em !important; margin: 0px !important; padding: 0px !important;"&gt;&lt;/CODE&gt;&lt;/DIV&gt;&lt;DIV class="" style="background: none white !important; border: 0px !important; font-size: 14px; margin: 0px !important; padding: 0px 1em !important;"&gt;&lt;CODE class="" style="color: blue !important; background: none !important; border: 0px !important; font-weight: normal !important; font-size: 1em !important; margin: 0px !important; padding: 0px !important;"&gt;&amp;nbsp;&lt;/CODE&gt;&lt;/DIV&gt;&lt;DIV class="" style="background: none white !important; border: 0px !important; font-size: 14px; margin: 0px !important; padding: 0px 1em !important;"&gt;&lt;CODE class="" style="color: blue !important; background: none !important; border: 0px !important; font-weight: normal !important; font-size: 1em !important; margin: 0px !important; padding: 0px !important;"&gt;&lt;SPAN style="color: #000000;"&gt;Obviously I need to replace the "print" statement (with the exception of "else"), but I don't know what to replace it with.&amp;nbsp;&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/DIV&gt;&lt;DIV class="" style="background: none white !important; border: 0px !important; font-size: 14px; margin: 0px !important; padding: 0px 1em !important;"&gt;&lt;CODE class="" style="color: blue !important; background: none !important; border: 0px !important; font-weight: normal !important; font-size: 1em !important; margin: 0px !important; padding: 0px !important;"&gt;&lt;/CODE&gt;&lt;/DIV&gt;&lt;DIV class="" style="background: none white !important; border: 0px !important; font-size: 14px; margin: 0px !important; padding: 0px 1em !important;"&gt;&lt;CODE class="" style="color: blue !important; background: none !important; border: 0px !important; font-weight: normal !important; font-size: 1em !important; margin: 0px !important; padding: 0px !important;"&gt;&lt;SPAN style="color: #000000;"&gt;Does anyone know what should replace "print"? Am I on the right track? Is there a better way to do what I'm trying to do?&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/DIV&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 05 Dec 2017 15:25:46 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/acpy-quot-if-quot-quot-elif-quot-and-quot-else/m-p/664965#M51635</guid>
      <dc:creator>Business_IntelligenceSoftware</dc:creator>
      <dc:date>2017-12-05T15:25:46Z</dc:date>
    </item>
    <item>
      <title>Re: Acpy "if", "elif", and "else" statement (ArcGIS Pro)</title>
      <link>https://community.esri.com/t5/python-questions/acpy-quot-if-quot-quot-elif-quot-and-quot-else/m-p/664966#M51636</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;What do you mean you're trying to select a .lyrx? &amp;nbsp;Like, pick out a file from a directory? &amp;nbsp;Or query an ArcGIS layer?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 05 Dec 2017 15:32:29 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/acpy-quot-if-quot-quot-elif-quot-and-quot-else/m-p/664966#M51636</guid>
      <dc:creator>MitchHolley1</dc:creator>
      <dc:date>2017-12-05T15:32:29Z</dc:date>
    </item>
    <item>
      <title>Re: Acpy "if", "elif", and "else" statement (ArcGIS Pro)</title>
      <link>https://community.esri.com/t5/python-questions/acpy-quot-if-quot-quot-elif-quot-and-quot-else/m-p/664967#M51637</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You had better get &lt;A href="http://pro.arcgis.com/en/pro-app/arcpy/mapping/layer-class.htm"&gt;&lt;STRONG&gt;a list of layers&lt;/STRONG&gt;&lt;/A&gt; and if the lyrx files reside on disk, then you will have to provide the paths to them.&amp;nbsp; I think your 'if' statement comes later, I would examine the code examples in the help topic I highlighted.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 05 Dec 2017 15:47:51 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/acpy-quot-if-quot-quot-elif-quot-and-quot-else/m-p/664967#M51637</guid>
      <dc:creator>DanPatterson_Retired</dc:creator>
      <dc:date>2017-12-05T15:47:51Z</dc:date>
    </item>
    <item>
      <title>Re: Acpy "if", "elif", and "else" statement (ArcGIS Pro)</title>
      <link>https://community.esri.com/t5/python-questions/acpy-quot-if-quot-quot-elif-quot-and-quot-else/m-p/664968#M51638</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I want it to select a .lyrx from a geodatabase from within an ArcGIS Pro project. Does that answer your question?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 05 Dec 2017 16:07:24 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/acpy-quot-if-quot-quot-elif-quot-and-quot-else/m-p/664968#M51638</guid>
      <dc:creator>Business_IntelligenceSoftware</dc:creator>
      <dc:date>2017-12-05T16:07:24Z</dc:date>
    </item>
    <item>
      <title>Re: Acpy "if", "elif", and "else" statement (ArcGIS Pro)</title>
      <link>https://community.esri.com/t5/python-questions/acpy-quot-if-quot-quot-elif-quot-and-quot-else/m-p/664969#M51639</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;If the layers are in the geodatabase, then the code sample(s) allow you to retrieve the list.&amp;nbsp; It is a matter then of comparing through your 'if' statement. &amp;nbsp;&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&lt;CODE&gt;my_layers &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; &lt;SPAN class="comment token"&gt;# this is where you get the list&lt;/SPAN&gt;
&lt;SPAN class="keyword token"&gt;if&lt;/SPAN&gt; Market_ID &lt;SPAN class="operator token"&gt;==&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;"1000"&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;:&lt;/SPAN&gt;&amp;nbsp;&amp;nbsp; &lt;SPAN class="comment token"&gt;# ---- don't put " " around numbers unless they are text ----&lt;/SPAN&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN class="keyword token"&gt;if&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;"NY_ZipCodes"&lt;/SPAN&gt; &lt;SPAN class="keyword token"&gt;in&lt;/SPAN&gt; my_layers&lt;SPAN class="punctuation token"&gt;:&lt;/SPAN&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN class="comment token"&gt;# then do something&lt;/SPAN&gt;
&lt;SPAN class="keyword token"&gt;elif&lt;/SPAN&gt; &lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;
&lt;SPAN class="comment token"&gt;# etc&lt;/SPAN&gt;&lt;SPAN class="line-numbers-rows"&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 12 Dec 2021 04:06:21 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/acpy-quot-if-quot-quot-elif-quot-and-quot-else/m-p/664969#M51639</guid>
      <dc:creator>DanPatterson_Retired</dc:creator>
      <dc:date>2021-12-12T04:06:21Z</dc:date>
    </item>
  </channel>
</rss>

