AnsweredAssumed Answered

ArcGIS Pro Calling Network Analysis Tools in Python

Question asked by dtrolling on Feb 6, 2018
Latest reply on Feb 6, 2018 by dtrolling

I am trying to use the Find Closest Facilities and/or the Make Service Area tool using Python inside of ArcGIS Pro. Since Pro establishes a connection to ArcGIS Online, a user is able to use these functions as 'Ready to Use' tools, as opposed to ArcMap where you were required to have the Network Analyst extension. I can manually use the tool on a sample set of data and produce results, but when I try to use them in Python or Modelbuilder, I have not had success.


I want to take a step back on this and pose a couple of general questions:

1) What do I need in my Python code to do this, so that I can run one of these tools inside a For loop?
2) How do I make a connection to my AGOL user account in Python and then import the tool (if necessary). Specifically, I've seen code such as:

gis = GIS("", "arcgis_python", "P@ssword123")
though, I am getting errors on invalid user name/passwords. Not sure if the URL is the issue either.


Basically, given that I can run the tool(s) manually, how do I run it iteratively/using Python?