<?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: TypeError :Abstract Class in Python Questions</title>
    <link>https://community.esri.com/t5/python-questions/typeerror-abstract-class/m-p/277587#M21417</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Scott - Your code executes fine for me in v10.1 SP1 (selection is made correctly). Are you sure that the SR you are trying to assign to your df extent polygon is okay? Is it defined? &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I have a layer in ArcMap TOC "County Bounadries", and this code executed correctly:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;mxd = arcpy.mapping.MapDocument("CURRENT")
df = mxd.activeDataFrame
polyObj = arcpy.Polygon(arcpy.Array([df.extent.lowerLeft, df.extent.lowerRight, df.extent.upperRight, df.extent.upperLeft]), df.spatialReference)
arcpy.SelectLayerByLocation_management("County Boundaries", "INTERSECT", polyObj)&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Sat, 11 Dec 2021 13:30:44 GMT</pubDate>
    <dc:creator>ChrisSnyder</dc:creator>
    <dc:date>2021-12-11T13:30:44Z</dc:date>
    <item>
      <title>TypeError :Abstract Class</title>
      <link>https://community.esri.com/t5/python-questions/typeerror-abstract-class/m-p/277585#M21415</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Good Day&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt; I hope I am posting this in the right place. We are having problems with a line of code and we are not sure what is causing the problem. We are running a script that will create data driven pages in pdf form. The line of code that is causing the problem is as follows&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="plain" name="code"&gt;&amp;nbsp; dfAsFeature = arcpy.Polygon(arcpy.Array([df.extent.lowerLeft, df.extent.lowerRight, df.extent.upperRight, df.extent.upperLeft]), df.spatialReference)
&amp;nbsp; arcpy.SelectLayerByLocation_management(gridLayer, "HAVE_THEIR_CENTER_IN", dfAsFeature, "", "NEW_SELECTION")&lt;/PRE&gt;&lt;DIV style="display:none;"&gt; &lt;/DIV&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;The dfAsFeature line always throws the TypeError:AbstractClass error. The odd part is, it works on ArcMap 10.0 but not 10.1. The 10.1 machine is using Python 2.7 while the 10.0 machine is running Python 2.6.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thank You&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Scott Shenberger&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Tucson Water&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 01 Nov 2012 15:54:14 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/typeerror-abstract-class/m-p/277585#M21415</guid>
      <dc:creator>ScottShenberger</dc:creator>
      <dc:date>2012-11-01T15:54:14Z</dc:date>
    </item>
    <item>
      <title>Re: TypeError :Abstract Class</title>
      <link>https://community.esri.com/t5/python-questions/typeerror-abstract-class/m-p/277586#M21416</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I don't know how to fix it, but before Python 2.6.x there was no explicit way to declare an abstract class. It changed with the abc (Abstract Base Class) module now available from the standard library in Python 2.7. I'm getting the same error with this line of code.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;partGeom = arcpy.Geometry("polygon", arcpy.Array(trPoints))&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;The variable partGeom probably needs to be declared now...&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Rich&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 24 Jun 2014 16:38:22 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/typeerror-abstract-class/m-p/277586#M21416</guid>
      <dc:creator>RichardDaniels</dc:creator>
      <dc:date>2014-06-24T16:38:22Z</dc:date>
    </item>
    <item>
      <title>Re: TypeError :Abstract Class</title>
      <link>https://community.esri.com/t5/python-questions/typeerror-abstract-class/m-p/277587#M21417</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Scott - Your code executes fine for me in v10.1 SP1 (selection is made correctly). Are you sure that the SR you are trying to assign to your df extent polygon is okay? Is it defined? &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I have a layer in ArcMap TOC "County Bounadries", and this code executed correctly:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;mxd = arcpy.mapping.MapDocument("CURRENT")
df = mxd.activeDataFrame
polyObj = arcpy.Polygon(arcpy.Array([df.extent.lowerLeft, df.extent.lowerRight, df.extent.upperRight, df.extent.upperLeft]), df.spatialReference)
arcpy.SelectLayerByLocation_management("County Boundaries", "INTERSECT", polyObj)&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 11 Dec 2021 13:30:44 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/typeerror-abstract-class/m-p/277587#M21417</guid>
      <dc:creator>ChrisSnyder</dc:creator>
      <dc:date>2021-12-11T13:30:44Z</dc:date>
    </item>
    <item>
      <title>Re: TypeError :Abstract Class</title>
      <link>https://community.esri.com/t5/python-questions/typeerror-abstract-class/m-p/277588#M21418</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Ha - Didn't notice that the OP was almost 2 years old!&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Issue was probably fixed with 10.1 SP1 I bet.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 24 Jun 2014 18:05:23 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/typeerror-abstract-class/m-p/277588#M21418</guid>
      <dc:creator>ChrisSnyder</dc:creator>
      <dc:date>2014-06-24T18:05:23Z</dc:date>
    </item>
  </channel>
</rss>

