<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
		>
<channel>
	<title>Comments on: Removing Empty Feature Classes with Python</title>
	<atom:link href="http://www.aubreyrhea.net/gis/index.php/2009/07/removing-empty-feature-classes-with-python/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.aubreyrhea.net/gis/index.php/2009/07/removing-empty-feature-classes-with-python/</link>
	<description>for ESRI&#039;s ArcGIS suite</description>
	<lastBuildDate>Thu, 08 Jul 2010 05:51:42 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0</generator>
	<item>
		<title>By: Bipin</title>
		<link>http://www.aubreyrhea.net/gis/index.php/2009/07/removing-empty-feature-classes-with-python/comment-page-1/#comment-599</link>
		<dc:creator>Bipin</dc:creator>
		<pubDate>Thu, 03 Jun 2010 11:17:07 +0000</pubDate>
		<guid isPermaLink="false">http://www.aubreyrhea.net/gis/?p=1#comment-599</guid>
		<description>Oh, crap...i think somebody can help with the indentation stuff. i&#039;m not a web pro when it comes to page styling.
or u can try this:
at 
while.mdb:
next line 1 tab, upto 
while fdset:
nextline 2 tabs, upto
while fc:
nextline 3 tabs,till fc=fcs.next()
then one tab back at fdset=listfdset.next()
one more tab back at mdb=listmdb.next()

additional:

gp.workspace = mdb + &quot;&quot; + fdset starts with 3 tabs after 
if not fdset == None:

both the lines:
gp.Delete_management(fc)
print fc + &quot; deleted from&quot; + mdb
starts with 4 tabs

sorry for the confusion, but it works. all the tabs are from the first column, except the coming back ones.
Happy automating!!!</description>
		<content:encoded><![CDATA[<p>Oh, crap&#8230;i think somebody can help with the indentation stuff. i&#8217;m not a web pro when it comes to page styling.<br />
or u can try this:<br />
at<br />
while.mdb:<br />
next line 1 tab, upto<br />
while fdset:<br />
nextline 2 tabs, upto<br />
while fc:<br />
nextline 3 tabs,till fc=fcs.next()<br />
then one tab back at fdset=listfdset.next()<br />
one more tab back at mdb=listmdb.next()</p>
<p>additional:</p>
<p>gp.workspace = mdb + &#8220;&#8221; + fdset starts with 3 tabs after<br />
if not fdset == None:</p>
<p>both the lines:<br />
gp.Delete_management(fc)<br />
print fc + &#8221; deleted from&#8221; + mdb<br />
starts with 4 tabs</p>
<p>sorry for the confusion, but it works. all the tabs are from the first column, except the coming back ones.<br />
Happy automating!!!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Fred</title>
		<link>http://www.aubreyrhea.net/gis/index.php/2009/07/removing-empty-feature-classes-with-python/comment-page-1/#comment-123</link>
		<dc:creator>Fred</dc:creator>
		<pubDate>Tue, 16 Feb 2010 03:21:11 +0000</pubDate>
		<guid isPermaLink="false">http://www.aubreyrhea.net/gis/?p=1#comment-123</guid>
		<description>I&#039;m having trouble with Martin&#039;s amended script.

I am no programmer... but I have had success with the original script provided, however I also wanted to remove feature datasets from my geodatabase.

When I run Martin&#039;s amended script (having changed my geodatabase workspace) the result is that my script appears to get stuck in the while loop, as the window shows my geodatabase workspace location repeating over and over and over again.

Any suggestions?</description>
		<content:encoded><![CDATA[<p>I&#8217;m having trouble with Martin&#8217;s amended script.</p>
<p>I am no programmer&#8230; but I have had success with the original script provided, however I also wanted to remove feature datasets from my geodatabase.</p>
<p>When I run Martin&#8217;s amended script (having changed my geodatabase workspace) the result is that my script appears to get stuck in the while loop, as the window shows my geodatabase workspace location repeating over and over and over again.</p>
<p>Any suggestions?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: admin</title>
		<link>http://www.aubreyrhea.net/gis/index.php/2009/07/removing-empty-feature-classes-with-python/comment-page-1/#comment-14</link>
		<dc:creator>admin</dc:creator>
		<pubDate>Sun, 04 Oct 2009 18:31:13 +0000</pubDate>
		<guid isPermaLink="false">http://www.aubreyrhea.net/gis/?p=1#comment-14</guid>
		<description>Thanks for the improved script, Martin! I didn&#039;t notice this because I&#039;ve only used it with geodatabases that weren&#039;t organized into feature datasets.</description>
		<content:encoded><![CDATA[<p>Thanks for the improved script, Martin! I didn&#8217;t notice this because I&#8217;ve only used it with geodatabases that weren&#8217;t organized into feature datasets.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Martin</title>
		<link>http://www.aubreyrhea.net/gis/index.php/2009/07/removing-empty-feature-classes-with-python/comment-page-1/#comment-11</link>
		<dc:creator>Martin</dc:creator>
		<pubDate>Mon, 28 Sep 2009 14:01:57 +0000</pubDate>
		<guid isPermaLink="false">http://www.aubreyrhea.net/gis/?p=1#comment-11</guid>
		<description>I tried your very useful script, but had to correct it a little bit. It cleaned only the first Feature DataSet, so I added an additional while-loop:

##############################################################
##  Delete Empty Feature Classes from Multiple Geodatabases
##
##  This script loops through all geodatabases within a directory
##  and removes empty featureclasses from each geodatabase.
##
##  User must hardcode directory.  Run this script in IDLE.
##
##  Python Version 2.4
##############################################################

# Create the Geoprocessor object
import arcgisscripting, os, sys, string
gp = arcgisscripting.create()

# Load required toolboxes...
gp.AddToolbox(&quot;C:\\Program Files\\ArcGIS\\ArcToolbox\\Toolboxes\\Conversion Tools.tbx&quot;)

# Set workspace
gp.workspace = &quot;C:\\tmp\\pgdb\\&quot;

# list personal geodatabases in the current workspace
listmdb = gp.listworkspaces(&quot;*&quot;, &quot;access&quot;)
##listmdb = gp.listworkspaces(&quot;*&quot;, &quot;FileGBD&quot;)
mdb = listmdb.next()

# loop through the personal geodatabases
while mdb:
    print mdb
    gp.workspace = mdb
    # list feature datasets in personal geodatabase
    listfdset=gp.listdatasets()
    fdset=listfdset.next()

    # loop through feature dataset
    while fdset:
        #print &quot;fdset: &quot;, fdset
        
        if not fdset == None:
            gp.workspace = mdb + &quot;\\&quot; + fdset
        # list feature classes in the personal geodatabase
        fcs = gp.listfeatureclasses()
        fcs.reset()
        fc = fcs.next()

        # loop through the featureclasses
        while fc:
            #print fc, gp.GetCount_management(fc)

            # if the feature class table has no records, delete the featureclass
            if gp.GetCount_management(fc) == 0:
                gp.Delete_management(fc)
                print fc + &quot;deleted from &quot; + mdb
            fc = fcs.next()

        fdset=listfdset.next()

    mdb = listmdb.next()</description>
		<content:encoded><![CDATA[<p>I tried your very useful script, but had to correct it a little bit. It cleaned only the first Feature DataSet, so I added an additional while-loop:</p>
<p>##############################################################<br />
##  Delete Empty Feature Classes from Multiple Geodatabases<br />
##<br />
##  This script loops through all geodatabases within a directory<br />
##  and removes empty featureclasses from each geodatabase.<br />
##<br />
##  User must hardcode directory.  Run this script in IDLE.<br />
##<br />
##  Python Version 2.4<br />
##############################################################</p>
<p># Create the Geoprocessor object<br />
import arcgisscripting, os, sys, string<br />
gp = arcgisscripting.create()</p>
<p># Load required toolboxes&#8230;<br />
gp.AddToolbox(&#8220;C:\\Program Files\\ArcGIS\\ArcToolbox\\Toolboxes\\Conversion Tools.tbx&#8221;)</p>
<p># Set workspace<br />
gp.workspace = &#8220;C:\\tmp\\pgdb\\&#8221;</p>
<p># list personal geodatabases in the current workspace<br />
listmdb = gp.listworkspaces(&#8220;*&#8221;, &#8220;access&#8221;)<br />
##listmdb = gp.listworkspaces(&#8220;*&#8221;, &#8220;FileGBD&#8221;)<br />
mdb = listmdb.next()</p>
<p># loop through the personal geodatabases<br />
while mdb:<br />
    print mdb<br />
    gp.workspace = mdb<br />
    # list feature datasets in personal geodatabase<br />
    listfdset=gp.listdatasets()<br />
    fdset=listfdset.next()</p>
<p>    # loop through feature dataset<br />
    while fdset:<br />
        #print &#8220;fdset: &#8220;, fdset</p>
<p>        if not fdset == None:<br />
            gp.workspace = mdb + &#8220;\\&#8221; + fdset<br />
        # list feature classes in the personal geodatabase<br />
        fcs = gp.listfeatureclasses()<br />
        fcs.reset()<br />
        fc = fcs.next()</p>
<p>        # loop through the featureclasses<br />
        while fc:<br />
            #print fc, gp.GetCount_management(fc)</p>
<p>            # if the feature class table has no records, delete the featureclass<br />
            if gp.GetCount_management(fc) == 0:<br />
                gp.Delete_management(fc)<br />
                print fc + &#8220;deleted from &#8221; + mdb<br />
            fc = fcs.next()</p>
<p>        fdset=listfdset.next()</p>
<p>    mdb = listmdb.next()</p>
]]></content:encoded>
	</item>
</channel>
</rss>
