views:

533

answers:

2

I'm trying to enumerate the contents (feature classes and feature datasets, not interested in tables, etc) of a file geodatabase using vba/arcobjects.

I have the file GDB set as an IGxDatabase object, but can't find a way of getting further in. I've had a look at the geodatabase object model and tried using IFeatureClass and IFeatureDataset but neither seem to return useful results.

Thanks in advance for any assistance

A: 

you can use the ListFeatureClasses Method on the Geoprocessor (the following shows how this can be done in C#)

IGeoProcessor gp = new GeoProcessorClass(); 

gp.SetEnvironmentValue("workspace", @"C:\temp"); 

IGpEnumList gpEnumList = gp.ListFeatureClasses("*", "Polygon", ""); 
string fc = gpEnumList.Next(); 
while (fc != "") 
{ 
//Do whatever
}
dev
+2  A: 
Kirk Kuykendall
+1 for looping through Names.
geographika