Hello
I am working on a script and I am stuck at the stage of plotting the shapefiles from gdb's to an existing 2 different aprx files.
I need to run the code from Pyscripter not from the ArcGIS Pro directly as there will be 2 aprx files.
Thanks!
I didn't test this, but this is the general idea:
shapefile_path = r"C:\PATH\Shapefile.shp" aprx_list = [r"C:\PATH\First.aprx", r"C:\PATH\Second.aprx"] import arcpy for aprx_path in aprx_list: p = arcpy.mp.ArcGISProject(aprx_path) m = p.listMaps()[0] # assumes data to be added to first map listed m.addDataFromPath(shapefile_path) p.save()
Thank you so much I just tried it and it worked!
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.