Can I reproduce a folder structure using a Project Template or Package in ArcGIS Pro?

1250
5
05-01-2018 10:44 AM
WalkerHenry
New Contributor II

I'm trying to find the easiest way to reproduce a standard file structure for each new project.

That doesn't seem to be how Templates work and the Package keeps my files but changes the folders.

I would like users to be able to open a new project and have our standard folders and file gdb prepopulate into the project folder.

Thanks,

Walker

5 Replies
ThomasColson
MVP Frequent Contributor

Right now I use a .exe (Made with WinRAR) that makes the folders, which includes a toolbox that they can fire to make a point, line, or poly that follows our org data standard, apply metadata (in Arc). I've sorta-played with rolling that up in a template, but got stuck on some template bugs. One idea would be to carry that further with some python that would create the folders, maybe python it all, attach to a tool and add to the analysis gallery, then roll that in a template. 

0 Kudos
WalkerHenry
New Contributor II

Thank you for the response Thomas. Unfortunately, I need to keep things off-the-shelf for our standard process as we don't have the resources to support anything custom.

So far, no one can tell me if this is currently possible. If I can get a hard no from Esri, I will submit an Idea and hopefully we'll be able to do this in a later release.

ThomasColson
MVP Frequent Contributor

I cooked up this py to meet my local need. Once a project is created, it will create all the directories in the project root. Edit line 13 to meet your need. Attach it to a toolbox. Not really that "custom"....

import os
import errno
import arcpy
folders = arcpy.GetParameterAsText(0)
curr = arcpy.mp.ArcGISProject("CURRENT").filePath
folder = "/".join(curr.split("\\")[:-1])+"/"

#This is the GIS project folder structure GRSM policy requires
#Edit this to meet your needs
#'Data\\Working' is where Create Standard GDB in Enforced Location in Pro Project will write the output FGDB
############
#EDIT ME
directories = ['Data','Data\\GPS','Data\\Working','Data\\Tabular','Products','Documents', 'Documents\\Pics_Graphics']
###########
basedirectory = folder +'\\'
for i in range (len (directories)):
    newDir = basedirectory + directories[i]
    try:
        os.makedirs(newDir)
    except OSError as exception:
        if exception.errno != errno.EEXIST:
           raise
        else:
           print ("\nBE CAREFUL! Directory %s already exists." % newDir)
0 Kudos
DalindaDamm
Occasional Contributor

Did you ever get any feedback from Esri on this question? I'm interested in whatever you might have figured out.

0 Kudos
TorbjørnDalløkken2
Occasional Contributor

I've added an idea for this functionality: Folder structure in project template - Esri Community

 

0 Kudos