Arcpy function for creating a new ArcGIS Project in ArcPro?

1120
4
Jump to solution
11-21-2021 02:02 AM
PhilipShutler
New Contributor III

Hi All,

 

I am looking for a function that would simply create a new arcgis project file. I have looked over the documentation for arcpy.mp functions and all I could find was a function that references a CURRENT project.

I have developed a script that iterates over points dataset performing analysis for each point in a particular area and then saves all the outputs to a new directory. I've set up the code to push the outputs to a newly created directory to better organize the project as a whole. Now I would like to create map outputs for that data analysis and save them to their respective directory.

It would be nice if there is a way to create a new ArcGIS project (aprx), to then add a new map to the project, then reference the layers I need for a particular area in the map, then symbolize, then save, and then finally loop to the next folder/set of data.  Based on this thread, it seems like arcpy.mp requires an already existing project and already existing maps. 

Also for reference, here is a post that shows how this process can be done for QGIS projects in Qgis. I am really hoping arcpro has something similar to this.  

Is this workflow possible? Are there known functions or workarounds to do this? Should I adjust my workflow? 

1 Solution

Accepted Solutions
PhilipShutler
New Contributor III

Workaround:

aprx = arcpy.mp.ArcGISProject(r"Template_File_Path")

aprx.saveACopy(r"New_File_Path")

 This will essentially create a project.

View solution in original post

0 Kudos
4 Replies
DanPatterson
MVP Esteemed Contributor

There is nothing to create a new project as you note from the documentation.  You can only use CURRENT or reference a project on disk by its path.  If you have the need to create a new project you will need to use a template project, then use Save As to save under a new name when you do anything to it so that the template isn't modified and you can specify a new location for the project

PS

it is already and Idea, but hasn't garnered much support

Provide ability to create new ArcGIS Pro projects ... - Esri Community

 


... sort of retired...
PhilipShutler
New Contributor III

Appreciate the workflow! I'm new to map production with python, most of my experience is geoprocessing. I'll check this out.

The other threads on this topic point me toward that new idea for esri to implement. Gave it kudos.

PhilipShutler
New Contributor III

Workaround:

aprx = arcpy.mp.ArcGISProject(r"Template_File_Path")

aprx.saveACopy(r"New_File_Path")

 This will essentially create a project.

0 Kudos
DanPatterson
MVP Esteemed Contributor

As I suggested


... sort of retired...
0 Kudos