Select to view content in your preferred language

Analyze Datasets

459
2
Jump to solution
01-03-2014 06:18 AM
ChrisMathers
Deactivated User
Just to be clear, because the help isnt explicit on this, if I leave in_datasets as an empty string in python Analyze Datasets will or will not run on all datasets? I assume it will as thats consistent with the behavior of other GP tools but I like things spelled out.
0 Kudos
1 Solution

Accepted Solutions
JakeSkinner
Esri Esteemed Contributor
Hi Chris,

It will not.  You will need to specify the datasets.  This parameter also accepts lists, so you could create a list of all your feature classes and pass that into the function.  Ex:

analyzeDatasets = []  for dataset in arcpy.ListDatasets("*"):     for featureClass in arcpy.ListFeatureClasses("*", "", dataset):         analyzeDatasets.append(featureClass)  for featureClass in arcpy.ListFeatureClasses("*"):     analyzeDatasets.append(featureClass)  arcpy.AnalyzeDatasets_management(env.workspace,"NO_SYSTEM",analyzeDatasets,"ANALYZE_BASE","ANALYZE_DELTA","ANALYZE_ARCHIVE")

View solution in original post

0 Kudos
2 Replies
JakeSkinner
Esri Esteemed Contributor
Hi Chris,

It will not.  You will need to specify the datasets.  This parameter also accepts lists, so you could create a list of all your feature classes and pass that into the function.  Ex:

analyzeDatasets = []  for dataset in arcpy.ListDatasets("*"):     for featureClass in arcpy.ListFeatureClasses("*", "", dataset):         analyzeDatasets.append(featureClass)  for featureClass in arcpy.ListFeatureClasses("*"):     analyzeDatasets.append(featureClass)  arcpy.AnalyzeDatasets_management(env.workspace,"NO_SYSTEM",analyzeDatasets,"ANALYZE_BASE","ANALYZE_DELTA","ANALYZE_ARCHIVE")
0 Kudos
ChrisMathers
Deactivated User
Thanks Jake
0 Kudos