<?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 array.removeAll() in Python Questions</title>
    <link>https://community.esri.com/t5/python-questions/array-removeall/m-p/257678#M19831</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I have an Array object I would like to clear using array.removeAll() however I keep getting the error:&lt;/SPAN&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&amp;lt;type 'exceptions.TypeError'&amp;gt;: unbound method removeAll() must be called with Array instance as first argument (got nothing instead)
&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Sun, 12 Dec 2021 16:15:42 GMT</pubDate>
    <dc:creator>MichaelFedak</dc:creator>
    <dc:date>2021-12-12T16:15:42Z</dc:date>
    <item>
      <title>array.removeAll()</title>
      <link>https://community.esri.com/t5/python-questions/array-removeall/m-p/257678#M19831</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I have an Array object I would like to clear using array.removeAll() however I keep getting the error:&lt;/SPAN&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&amp;lt;type 'exceptions.TypeError'&amp;gt;: unbound method removeAll() must be called with Array instance as first argument (got nothing instead)
&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 12 Dec 2021 16:15:42 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/array-removeall/m-p/257678#M19831</guid>
      <dc:creator>MichaelFedak</dc:creator>
      <dc:date>2021-12-12T16:15:42Z</dc:date>
    </item>
    <item>
      <title>Re: array.removeAll()</title>
      <link>https://community.esri.com/t5/python-questions/array-removeall/m-p/257679#M19832</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Could you paste a larger code snippet for context?&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 02 Mar 2011 17:35:29 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/array-removeall/m-p/257679#M19832</guid>
      <dc:creator>JasonScheirer</dc:creator>
      <dc:date>2011-03-02T17:35:29Z</dc:date>
    </item>
    <item>
      <title>Re: array.removeAll()</title>
      <link>https://community.esri.com/t5/python-questions/array-removeall/m-p/257680#M19833</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Sorry, here is the code till the line where it fails. I based it on the fourth example here: &lt;/SPAN&gt;&lt;A href="http://help.arcgis.com/en/arcgisdesktop/10.0/help/index.html#/DataFrame/00s300000003000000/" rel="nofollow noopener noreferrer" target="_blank"&gt;http://help.arcgis.com/en/arcgisdesktop/10.0/help/index.html#/DataFrame/00s300000003000000/&lt;/A&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;import arcpy,os
#Declare Variables
mxd = arcpy.GetParameter(0)
outLocation = arcpy.GetParameterAsText(1)
outName= arcpy.GetParameterAsText(2)+".shp"
outPath = os.path.join(outLocation,outName)
featureList = []
ar=arcpy.Array

#Export the table values to a string
maps=mxd.exportToString()
#Remove field delimiters
maps = maps.replace("'",'').strip()
arcpy.AddMessage(maps)
maplist= maps.split(';')
arcpy.AddMessage(maplist)

#Cycle through list of maps

for mapp in maplist: 
 
 arcpy.AddMessage(mapp)
 mxd1 = arcpy.mapping.MapDocument(mapp)
 
 frames = arcpy.mapping.ListDataFrames(mxd1)
 
 #Cycle through the list
 for df in frames:&amp;nbsp; 
&amp;nbsp; #Creates a polygon object 
&amp;nbsp; poly = arcpy.Polygon(ar([df.extent.lowerLeft, df.extent.lowerRight, df.extent.upperRight, df.extent.upperLeft]),
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; df.spatialReference)&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 
&amp;nbsp; featureList.append(poly)
&amp;nbsp; 
&amp;nbsp; #Remove the array for the next polygon 
&amp;nbsp; ar.removeAll(ar) &lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 11 Dec 2021 12:41:50 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/array-removeall/m-p/257680#M19833</guid>
      <dc:creator>MichaelFedak</dc:creator>
      <dc:date>2021-12-11T12:41:50Z</dc:date>
    </item>
    <item>
      <title>Re: array.removeAll()</title>
      <link>https://community.esri.com/t5/python-questions/array-removeall/m-p/257681#M19834</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;You don't need to clear it out each time the way you are, each instance of Array is a stand-alone object:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;for df in frames:&amp;nbsp; 
&amp;nbsp; #Creates a polygon object 
&amp;nbsp; poly = arcpy.Polygon(arcpy.Array([df.extent.lowerLeft, df.extent.lowerRight, df.extent.upperRight, df.extent.upperLeft]),
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; df.spatialReference)&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 
&amp;nbsp; featureList.append(poly)
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; # All done&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 11 Dec 2021 12:41:52 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/array-removeall/m-p/257681#M19834</guid>
      <dc:creator>JasonScheirer</dc:creator>
      <dc:date>2021-12-11T12:41:52Z</dc:date>
    </item>
    <item>
      <title>Re: array.removeAll()</title>
      <link>https://community.esri.com/t5/python-questions/array-removeall/m-p/257682#M19835</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Excellent, thank you.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 02 Mar 2011 21:57:20 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/array-removeall/m-p/257682#M19835</guid>
      <dc:creator>MichaelFedak</dc:creator>
      <dc:date>2011-03-02T21:57:20Z</dc:date>
    </item>
  </channel>
</rss>

