# Name: UpgradeNetwork_Workflow.py
# Description: Upgrades the schema of a network dataset by first upgrading the
# geodatabase containing the network dataset and then upgrading the
# network dataset. The network dataset is also built so that it can
# be used to perform network analyses.
# Requirements: Network Analyst Extension
#Import system modules
from arcpy import env
#Set environment settings
env.workspace = "C:/data/RhodeIsland.gdb"
env.overwriteOutput = True
#Set local variables
#inNetworkDataset = "Transportation/Streets_ND"
inNetworkDataset = "RhodeIsland/RhodeIsland_ND"
#Before upgrading the network dataset, upgrade the file GDB that contains
#the network dataset
#Upgrade the network dataset
#The upgraded network dataset is not built. So build the network dataset
print("Script completed successfully")
except Exception as e:
# If an error occurred, print line number and error message
import traceback, sys
tb = sys.exc_info()
print("An error occurred on line %i" % tb.tb_lineno)