<?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: arcpy.mp adding excluded values and reclassify in Python Questions</title>
    <link>https://community.esri.com/t5/python-questions/arcpy-mp-adding-excluded-values-and-reclassify/m-p/1033160#M60217</link>
    <description>&lt;P&gt;&lt;STRIKE&gt;Good&lt;/STRIKE&gt; Great news, the ArcGIS Pro dev team is working on this. Thank you&amp;nbsp;&lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/1134"&gt;@JeffBarrette&lt;/a&gt;&amp;nbsp;&lt;BR /&gt;Esri Case #02746274 - arcpy.mapping symbology.excludedValues issue&lt;/P&gt;</description>
    <pubDate>Thu, 04 Mar 2021 21:54:43 GMT</pubDate>
    <dc:creator>curtvprice</dc:creator>
    <dc:date>2021-03-04T21:54:43Z</dc:date>
    <item>
      <title>arcpy.mp adding excluded values and reclassify</title>
      <link>https://community.esri.com/t5/python-questions/arcpy-mp-adding-excluded-values-and-reclassify/m-p/1028881#M60040</link>
      <description>&lt;P&gt;Trying to get implement an ArcMap (arcpy.mapping) to ArcGIS Pro 2.7&amp;nbsp;&lt;/P&gt;&lt;P&gt;Here's what I have in ArcMap:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="python"&gt;fringe_shades = os.path.join(os.path.dirname(__file__),
    "lyr", "Fringe{}.lyr".format(cycles))
outlyr = arcpy.mapping.Layer(fringe_shades)
pth = os.path.dirname(rast.catalogPath)
outlyr.replaceDataSource(pth, "NONE", os.path.basename(rast.catalogPath))
outlyr.symbology.excludedValues = ex_str
outlyr.symbology.reclassify()
outlyr.name = results
# add to map
mxd = arcpy.mapping.MapDocument("CURRENT")
arcpy.mapping.AddLayer(mxd.activeDataFrame, outlyr)
arcpy.RefreshActiveView()&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I can't see a way to apply an exclusion and reclassify in arcpy.mp. Here's what I have so far. I don't seem to be able to add my layer to map like I did in ArcMap as I m.addLayer doesn't seem to let me add a geoprocessing layer object to my map. So I'm adding it using the GP environment.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="python"&gt;outlyr = arcpy.MakeRasterLayer_management(rast.catalogPath, results)
fringe_shades = os.path.join(os.path.dirname(__file__),
     "lyrx", "Fringe{}.lyrx".format(cycles))   
outlyr = arcpy.ApplySymbologyFromLayer_management(outlyr, fringe_shades, None, "UPDATE")        
parameters[5].value = outlyr
arcpy.SetParameterAsText(5, outlyr)&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;It seems like I should be able to use the arcpy.mp.Layerfile() class to access a Layer object, but I don't seem to have anything like the .reclassify() method.&lt;/P&gt;&lt;P&gt;The ApplySymbologyFromLayer tool works with a geoprocessing layer object, applying new data ranges, but then I can't exclusions and reclassify. I had to write a separate tool to apply exclusions after I added the raster layer tot he map using CIM access -- but I can't reclassify, just turn the pixels off by setting the exclusion values:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="python"&gt;# use CIM to set exclusion ranges
p = arcpy.mp.ArcGISProject("CURRENT") 
m = p.activeMap
ly = m.listLayers(parameters[0].valueAsText)[0]
lyc = ly.getDefinition('V2')
lyc.colorizer.exclusionRanges = [-.0001, .0001]
ly.setDefinition(lyc)&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;This works for me, but wish I could figure out how to do it in the main tool.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sun, 21 Feb 2021 06:32:25 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/arcpy-mp-adding-excluded-values-and-reclassify/m-p/1028881#M60040</guid>
      <dc:creator>curtvprice</dc:creator>
      <dc:date>2021-02-21T06:32:25Z</dc:date>
    </item>
    <item>
      <title>Re: arcpy.mp adding excluded values and reclassify</title>
      <link>https://community.esri.com/t5/python-questions/arcpy-mp-adding-excluded-values-and-reclassify/m-p/1033160#M60217</link>
      <description>&lt;P&gt;&lt;STRIKE&gt;Good&lt;/STRIKE&gt; Great news, the ArcGIS Pro dev team is working on this. Thank you&amp;nbsp;&lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/1134"&gt;@JeffBarrette&lt;/a&gt;&amp;nbsp;&lt;BR /&gt;Esri Case #02746274 - arcpy.mapping symbology.excludedValues issue&lt;/P&gt;</description>
      <pubDate>Thu, 04 Mar 2021 21:54:43 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/arcpy-mp-adding-excluded-values-and-reclassify/m-p/1033160#M60217</guid>
      <dc:creator>curtvprice</dc:creator>
      <dc:date>2021-03-04T21:54:43Z</dc:date>
    </item>
  </channel>
</rss>

