AnsweredAssumed Answered

Create a Network Dataset using a Template in ArcPy - Error

Question asked by GWTHOMSON1 on Jan 24, 2019
Latest reply on Jan 24, 2019 by GWTHOMSON1

Hi there,


I'm trying to create a network dataset using a template in Arcpy (my current installed version of ArcPro is 2.2.4 and I'm using the python version associated with this). I'm going to have to make around 20 of these and would prefer to not need to make them manually.


My hope was to create one, export the xml template, and then use that in a loop for each required network dataset (e.g. Network_2018, Network_2019 etc...). I assumed that by editing the input feature class and output network name in the xml to suit each required parameter this shouldn't be a problem (the schema is identical on all of these feature classes).


Here is my current code below:


import arcpy


new_network_location = r"C:\Users\Gavin\Desktop\Test Folder\Test_Geodatabase\TM_Analysis.gdb\Networks"
xml_template = r"C:\Users\Gavin\Desktop\Test Folder\Template_ND.xml", xml_template)



It all feels fairly straight forward, but I've been trying to get even a test version to work and I'm receiving the following error (this is before any changes to the xml or looping through different networks etc.):


arcgisscripting.ExecuteError: Failed to execute. Parameters are not valid.
ERROR 030176: The input file is not a valid XML file.
ERROR 030178: The output feature dataset is not valid.
Failed to execute (CreateNetworkDatasetFromTemplate).


Any help would be greatly appreciated!