<?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: HELP! Need to generate an exclusion rule at the beginning of the python script based on values from a specific field of a gdb in Python Questions</title>
    <link>https://community.esri.com/t5/python-questions/help-need-to-generate-an-exclusion-rule-at-the/m-p/1036669#M60408</link>
    <description>&lt;P&gt;Post your code with formatting if you could&lt;/P&gt;&lt;P&gt;&lt;A href="https://community.esri.com/t5/python-blog/code-formatting-the-community-version/ba-p/1007633" target="_blank"&gt;Code formatting ... the Community Version - Esri Community&lt;/A&gt;&lt;/P&gt;&lt;P&gt;Reading from a screen grab is difficult.&amp;nbsp;&lt;/P&gt;&lt;P&gt;It appears you have some encoding issues.&amp;nbsp; Is this line at the top of your script?&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;# -*- coding: utf-8 -*-&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;and are doing this in arcgis pro with python 3?&amp;nbsp; a separate python IDE?&lt;/P&gt;&lt;P&gt;anything useful to your environment would help&lt;/P&gt;</description>
    <pubDate>Mon, 15 Mar 2021 15:59:18 GMT</pubDate>
    <dc:creator>DanPatterson</dc:creator>
    <dc:date>2021-03-15T15:59:18Z</dc:date>
    <item>
      <title>HELP! Need to generate an exclusion rule at the beginning of the python script based on values from a specific field of a gdb</title>
      <link>https://community.esri.com/t5/python-questions/help-need-to-generate-an-exclusion-rule-at-the/m-p/1036646#M60406</link>
      <description>&lt;P&gt;I am working on a file GDB containing polygons with multiple fields and values.&amp;nbsp;One of the text fields of that GDB is filled by applying a python script that uses the information of many other fields to generate the text values&lt;SPAN&gt;.&lt;BR /&gt;That script works very well, but I need to add an exclusion rule at the beginning&amp;nbsp; so it will not be applied on certain polygons based on specific values from a certain field (the goal is not to overwrite the values of those polygons which values are gonna be manually written before running the script).&lt;BR /&gt;In applied words, the script gives an Ecosystem name for each polygon based on biological and geomorphological field values, but I don't want the script to be processed on polygons that contains validation data from a certain source. In that case, it means I don't want it to be processed when the ''Validation'' field equals 4 specific values (which are specific sources of validation), because those Ecosystem names have to and are written manually before running the script and I don't want to overwrite them.&amp;nbsp; (See the screenshot I've joined)&lt;BR /&gt;&lt;BR /&gt;I should specify that I am not the one that wrote the script initially. The person left so I need to find my way around and I am a complete beginner in python scripting. I was hoping someone could give me a hand and tell me if there is a straightforward way for this. Thank you!!!&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 15 Mar 2021 15:10:10 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/help-need-to-generate-an-exclusion-rule-at-the/m-p/1036646#M60406</guid>
      <dc:creator>Laurence</dc:creator>
      <dc:date>2021-03-15T15:10:10Z</dc:date>
    </item>
    <item>
      <title>Re: HELP! Need to generate an exclusion rule at the beginning of the python script based on values from a specific field of a gdb</title>
      <link>https://community.esri.com/t5/python-questions/help-need-to-generate-an-exclusion-rule-at-the/m-p/1036669#M60408</link>
      <description>&lt;P&gt;Post your code with formatting if you could&lt;/P&gt;&lt;P&gt;&lt;A href="https://community.esri.com/t5/python-blog/code-formatting-the-community-version/ba-p/1007633" target="_blank"&gt;Code formatting ... the Community Version - Esri Community&lt;/A&gt;&lt;/P&gt;&lt;P&gt;Reading from a screen grab is difficult.&amp;nbsp;&lt;/P&gt;&lt;P&gt;It appears you have some encoding issues.&amp;nbsp; Is this line at the top of your script?&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;# -*- coding: utf-8 -*-&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;and are doing this in arcgis pro with python 3?&amp;nbsp; a separate python IDE?&lt;/P&gt;&lt;P&gt;anything useful to your environment would help&lt;/P&gt;</description>
      <pubDate>Mon, 15 Mar 2021 15:59:18 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/help-need-to-generate-an-exclusion-rule-at-the/m-p/1036669#M60408</guid>
      <dc:creator>DanPatterson</dc:creator>
      <dc:date>2021-03-15T15:59:18Z</dc:date>
    </item>
    <item>
      <title>Re: HELP! Need to generate an exclusion rule at the beginning of the python script based on values from a specific field of a gdb</title>
      <link>https://community.esri.com/t5/python-questions/help-need-to-generate-an-exclusion-rule-at-the/m-p/1036731#M60413</link>
      <description>&lt;P&gt;Hi Dan !&amp;nbsp;&lt;BR /&gt;Thanks for your answer and your help. Actually, ideally I'm not willing to change the content of the actual script which works well and I'm affraid I would mess it. If it is possible, I would only want a line of code code at the beginning&amp;nbsp; that will exclude some polygons (lines in the attribute fields) for which the code will generate a value (and leave the name of the Ecosystem as it is). In this case, It means that all polygons for which&amp;nbsp; Valid_terr = "UQAR 2018 et IML2018 (à venir)" would not have their Ecosystem names overwritten.&lt;/P&gt;&lt;P&gt;I'm working in ArcMAp 10.7 and I run the code in the attribut table with the Field calculator (after having joined the domain tables by right clicking on my feature class layer &amp;gt; Join and relate &amp;gt; Join). The code was written in an external python IDE (like PythonWin or NotePadd++ I don't know exactly.&lt;/P&gt;&lt;P&gt;Maybe the answer of my question cannot be as straightforward as I think it can !;P&lt;BR /&gt;Let me know if you still think I should post my code on Code Formatting! I clicked on your link, i'm not sure, is it an other forum specifically for code questions or it's a place to put my script relate from my post here?&lt;/P&gt;</description>
      <pubDate>Mon, 15 Mar 2021 17:46:59 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/help-need-to-generate-an-exclusion-rule-at-the/m-p/1036731#M60413</guid>
      <dc:creator>Laurence</dc:creator>
      <dc:date>2021-03-15T17:46:59Z</dc:date>
    </item>
    <item>
      <title>Re: HELP! Need to generate an exclusion rule at the beginning of the python script based on values from a specific field of a gdb</title>
      <link>https://community.esri.com/t5/python-questions/help-need-to-generate-an-exclusion-rule-at-the/m-p/1036749#M60414</link>
      <description>&lt;P&gt;The link I posted shows your you post code in your questions.&lt;/P&gt;&lt;P&gt;It is the only way to really see whether there are syntax and/or formatting errors and you can scroll up and down within a thread to look at code but you can't do that when an image is posted.&lt;/P&gt;</description>
      <pubDate>Mon, 15 Mar 2021 17:54:07 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/help-need-to-generate-an-exclusion-rule-at-the/m-p/1036749#M60414</guid>
      <dc:creator>DanPatterson</dc:creator>
      <dc:date>2021-03-15T17:54:07Z</dc:date>
    </item>
    <item>
      <title>Re: HELP! Need to generate an exclusion rule at the beginning of the python script based on values from a specific field of a gdb</title>
      <link>https://community.esri.com/t5/python-questions/help-need-to-generate-an-exclusion-rule-at-the/m-p/1036973#M60418</link>
      <description>&lt;P&gt;One thing to keep in mind is that when you run any tool on a layer or table vies it only applies to the selected set of rows. So if the polygon code that is "filling values" is working on a layer, you can apply a selection to the layer or table view before executing your script.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 16 Mar 2021 02:02:40 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/help-need-to-generate-an-exclusion-rule-at-the/m-p/1036973#M60418</guid>
      <dc:creator>curtvprice</dc:creator>
      <dc:date>2021-03-16T02:02:40Z</dc:date>
    </item>
    <item>
      <title>Re: HELP! Need to generate an exclusion rule at the beginning of the python script based on values from a specific field of a gdb</title>
      <link>https://community.esri.com/t5/python-questions/help-need-to-generate-an-exclusion-rule-at-the/m-p/1037074#M60422</link>
      <description>&lt;P&gt;Your screenshot shows how the variable "ecosystem" is calculated, but not how it is written into the feature class.&lt;/P&gt;&lt;P&gt;&amp;nbsp;I understand that you don't want to post the whole script, but to help you, we need to know how the field is written.&lt;/P&gt;&lt;P&gt;Please tell us:&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;Dou you run the script in the Python Window in ArcGIS?&lt;UL&gt;&lt;LI&gt;If yes: ArcMap or ArcGIS Pro?&lt;/LI&gt;&lt;LI&gt;If yes: Do you need the feature class loaded in the map as a layer?&lt;/LI&gt;&lt;/UL&gt;&lt;/LI&gt;&lt;LI&gt;Do you run the script as a standalone script (e.g. double click or from the command line or a Python IDE)?&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;Please look for code blocks that include any of the following and post them:&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;arcpy.da.UpdateCursor&lt;/LI&gt;&lt;LI&gt;arcpy.UpdateCursor&lt;/LI&gt;&lt;LI&gt;arcpy.CalculateField_management&lt;/LI&gt;&lt;LI&gt;arcpy.management.CalculateField&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 16 Mar 2021 12:03:45 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/help-need-to-generate-an-exclusion-rule-at-the/m-p/1037074#M60422</guid>
      <dc:creator>JohannesLindner</dc:creator>
      <dc:date>2021-03-16T12:03:45Z</dc:date>
    </item>
    <item>
      <title>Re: HELP! Need to generate an exclusion rule at the beginning of the python script based on values from a specific field of a gdb</title>
      <link>https://community.esri.com/t5/python-questions/help-need-to-generate-an-exclusion-rule-at-the/m-p/1037104#M60423</link>
      <description>&lt;P&gt;&lt;SPAN&gt;That would have been a good tip, but I want it to be part of the script, because other people in time will be applying it and I don't want to risk to overwrite anything. But thanks for your answer! &lt;span class="lia-unicode-emoji" title=":winking_face:"&gt;😉&lt;/span&gt;&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 16 Mar 2021 13:30:27 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/help-need-to-generate-an-exclusion-rule-at-the/m-p/1037104#M60423</guid>
      <dc:creator>Laurence</dc:creator>
      <dc:date>2021-03-16T13:30:27Z</dc:date>
    </item>
  </channel>
</rss>

