Take the 2-minute tour ×
Geographic Information Systems Stack Exchange is a question and answer site for cartographers, geographers and GIS professionals. It's 100% free, no registration required.

I am fairly new to arcpy and I am having troubles recreating the following set of instructions with a python script.

  1. Open the KeyChainTest.mxd
  2. Enable the Network Analyst extension.
  3. Click solve on the Network Analyst toolbar. The green route line should go through the large point, which represents a locked door. If it avoids the door by going the long way around the block, the test has failed.
  4. Double-click the Route layer in the TOC to open the Layer Properties. Click the Attribute Paramters tab. For the KeyIDs parameter, remove to essentially indicate you don't have the key for the door anymore.
  5. Click OK to close the Layer Properties dialog box. Solve again.
  6. The route should should take the long way around to avoid the door. If it goes through the door, the test has failed.

I have all the data setup, I just don't understand how I would go about solving with arcpy and then check whether the solve worked correctly.

Thanks for your time!

(If I need to narrow down something or add additional information don't hesitate to ask)

share|improve this question
Could be useful to use the model builder and then convert to code –  Moggy Jul 17 '13 at 21:47
The online help for arcpy.na will also be important to become familiar with. What does your code look like so far? –  PolyGeo Jul 17 '13 at 21:53

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Browse other questions tagged or ask your own question.