<?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: How can I get currentLayer Property to work in a Python Add-in  in Python AddIns Questions</title>
    <link>https://community.esri.com/t5/python-addins-questions/how-can-i-get-currentlayer-property-to-work-in-a/m-p/856009#M118</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I did end up getting this filed as a bug.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 12.0pt;"&gt;BUG-000113895 : current.Layer does not output the active layer being edited.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 12.0pt;"&gt;My workaround ended up being to use the Attribute Assistant add-on.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 25 Jun 2018 22:03:49 GMT</pubDate>
    <dc:creator>Brian_Wilson</dc:creator>
    <dc:date>2018-06-25T22:03:49Z</dc:date>
    <item>
      <title>How can I get currentLayer Property to work in a Python Add-in</title>
      <link>https://community.esri.com/t5/python-addins-questions/how-can-i-get-currentlayer-property-to-work-in-a/m-p/856008#M117</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I have written a Python add-in extension for ArcMap 10.6, I want it to automatically update some attributes after a feature is edited or created. My test code looks like this:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;BLOCKQUOTE class="jive_macro_quote jive-quote jive_text_macro"&gt;&lt;P&gt;def onStopOperation(self):&lt;BR /&gt;&amp;nbsp; print("%d onStopOperation(self)" % self.count)&lt;BR /&gt;&amp;nbsp; self.count += 1&lt;BR /&gt;&amp;nbsp; print("Workspace ", self.editWorkspace)&lt;BR /&gt;&amp;nbsp; print("Selected ", self.editSelection)&lt;BR /&gt;&amp;nbsp; print("currentLayer", self.currentLayer)&lt;BR /&gt;&amp;nbsp; obj = pythonaddins.GetSelectedTOCLayerOrDataFrame()&lt;BR /&gt;&amp;nbsp; print("current toc", obj)&lt;/P&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;My add-in catches ALL available events, and it looks like currentLayer is set to None everywhere not just in onStopOperation.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This is typical output&lt;/P&gt;&lt;BLOCKQUOTE class="jive_macro_quote jive-quote jive_text_macro"&gt;&lt;P&gt;16 onStopOperation(self)&lt;BR /&gt;Workspace C:\GeoModel\Clatsop\WorkFolder\ORMAP_Clatsop.gdb&lt;BR /&gt;Selected [32183]&lt;BR /&gt;currentLayer None&lt;BR /&gt;current thing Taxlot&lt;/P&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;I would potentially be able to search the TOC for layer "Taxlot" but if someone clicks on another layer or edits a feature in a different layer it won't match up. I still need currentLayer to return an actual value for this to work smoothly.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I searched for some other way to detect what feature class is being edited, for example properties and methods on the map document object and on the layer objects but I don't see anything.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Since this seems like a bug to me I also filed it with ESRI, but I don't really want to wait until a release comes out, I need a work around.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 17 Apr 2018 18:39:14 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-addins-questions/how-can-i-get-currentlayer-property-to-work-in-a/m-p/856008#M117</guid>
      <dc:creator>Brian_Wilson</dc:creator>
      <dc:date>2018-04-17T18:39:14Z</dc:date>
    </item>
    <item>
      <title>Re: How can I get currentLayer Property to work in a Python Add-in</title>
      <link>https://community.esri.com/t5/python-addins-questions/how-can-i-get-currentlayer-property-to-work-in-a/m-p/856009#M118</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I did end up getting this filed as a bug.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 12.0pt;"&gt;BUG-000113895 : current.Layer does not output the active layer being edited.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 12.0pt;"&gt;My workaround ended up being to use the Attribute Assistant add-on.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 25 Jun 2018 22:03:49 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-addins-questions/how-can-i-get-currentlayer-property-to-work-in-a/m-p/856009#M118</guid>
      <dc:creator>Brian_Wilson</dc:creator>
      <dc:date>2018-06-25T22:03:49Z</dc:date>
    </item>
  </channel>
</rss>

