Contents
How to get all the featureclasses from a workspace?
This is my function to get all the FeatureClasses from a workspace: My problem is that I can’t get all the FeatureClasses (5), sometimes I get 2 and sometimes only 1 FeatureClass. Couple things wrong in your loop. First you are calling dataset = datasets.Next (); at top and bottom of the loop. Right there you are skipping some feature classes.
How to get all feature classes from ArcObjects?
Right there you are skipping some feature classes. If your feature classes are nested in a Feature Dataset then you have to iterate through it also. It’s a good idea to call IEnumDataset.Reset () before starting the loop to ensure you are at the start.
How to use listfeatureclasses in ArcGIS 10.2?
Lists the feature classes in the workspace, limited by name, feature type, and optional feature dataset. The workspace environment must be set first before using several of the List functions, including ListDatasets, ListFeatureClasses, ListFiles, ListRasters, ListTables, and ListWorkspaces. The wild_card limits the results returned.
Do you need to set workspace environment before using list functions?
The workspace environment must be set before using several of the list functions, including ListDatasets, ListFeatureClasses, ListFiles, ListRasters, ListTables, and ListWorkspaces. Syntax ListFeatureClasses ({wild_card}, {feature_type}, {feature_dataset})
How to find the current workspace in ArcGIS?
The logic for generating the output name is as follows: If the scratch workspace environment is set, the autogenerated output path will be the scratch workspace. If the scratch workspace environment is not set, the current workspace environment is examined. If current workspace is set, the autogenerated output will be the current workspace.
What happens if neither scratch or current workspace is set?
If neither the scratch or current workspace is set, the autogenerated output path will be the workspace of one of the inputs. In this case, certain restrictions apply. For example, if the workspace is a coverage workspace and the output is a new feature class, the output will be a shapefile to the directory above the coverage workspace.
How is the current workspace set in ArcCatalog?
In ArcCatalog, the Scratch Workspace and Current Workspace environments are not set by default. When using the tool dialog box, output dataset names are autogenerated using the current and scratch workspace settings. The logic for generating the output name is as follows: