###------------------------------ #Import standard library modules <- use arcgisscripting instead of win32com.client import arcgisscripting, sys, os #Create the Geoprocessor object GP = arcgisscripting.create(9.3) # use arcgisscripting.create() if your Arc is < 9.3 #Set the workspace. GP.Workspace= r"C:\test" GP.Toolbox = "Data Management" # <- should not have to be loaded try: #Get a list of the featureclasses in the input folder fcs = GP.ListFeatureClasses() for fc in fcs: # <- fcs is a list, not a cursor, so you do not use .next() # Add X Y coordinate to the feature classes GP.AddXY_management(fc) except: GP.AddMessage(GP.GetMessages(2)) print GP.GetMessages(2)
Angemeldete Mitglieder können Beiträge verfassen, Updates folgen und mehr. Neu hier? Registriere ein kostenloses Konto.
Find useful guides, FAQs, and documents to help you navigate and make the most of Esri Community.