arcpy.env.workspace = r"C;\\CountyData\\County.gdb' outpath = r"C:\\Test\\test.gdb" flist = arcpy.ListDatasets('*WildCard*', {feature_type}) for f in flist: output = outpath + os.sep + f arcpy.CopyFeatures_management(f, output)
Mike,You can use the ListDatasets function. arcpy.env.workspace = r"C;\\CountyData\\County.gdb' outpath = r"C:\\Test\\test.gdb" flist = arcpy.ListDatasets('*WildCard*', {feature_type}) for f in flist: output = outpath + os.sep + f arcpy.CopyFeatures_management(f, output) http://help.arcgis.com/en/arcgisdesktop/10.0/help/index.html#//000v0000001m000000http://help.arcgis.com/en/arcgisdesktop/10.0/help/index.html#//001700000035000000
arcpy.env.workspace = r"C;\\CountyData\\County.gdb' outpath = r"C:\\Test\\test.gdb" flist = arcpy.ListDatasets('Cedar*') for f in flist: output = outpath + os.sep + f arcpy.CopyFeatures_management(f, output)
import arcpy, os, sys, traceback arcpy.env.workspace = r"G:\Testing\USA.gdb" arcpy.env.overwriteOutput = True outpath = r"G:\testing2\new.gdb" pre = 'COL_LCT_SDE.' try: fdlist = arcpy.ListDatasets('*', "Feature") tocopy1 = pre + 'Managed' tocopy2 = pre + 'Public' tocopy3 = pre + 'Reference' tocopy4 = pre + 'TCA' tocopy5 = pre + 'Anno' for fd in fdlist: pastefd = outpath + os.sep + str(fd) if fd == tocopy1: arcpy.Copy_management(fd, pastefd) if fd == tocopy2: arcpy.Copy_management(fd, pastefd) if fd == tocopy3: arcpy.Copy_management(fd, pastefd) if fd == tocopy4: arcpy.Copy_management(fd, pastefd) if fd == tocopy5: arcpy.Copy_management(fd, pastefd) except: arcpy.AddError(arcpy.GetMessages(2))
Aangemelde leden kunnen berichten plaatsen, updates volgen en meer. Nieuw hier? Registreer een gratis account.
Find useful guides, FAQs, and documents to help you navigate and make the most of Esri Community.