Run the model outside of ArcMap or ArcCatalog

Geoprocessing tools cannot be directly run outside of the ArcMap or ArcCatalog context. In order to accomplish this, you must export your model as a python script. This requires a completed, properly functioning model.

NOTE: If you used either of the methods described above to export feeder information to .csv, .dxf, or .dwg files, and you plan to run its python script as a scheduled task, you should populate the OutputLocation field and resave the model. This ensures that your scheduled task won't wait for you to specify an output file path before running.
  1. In the Model window, click Model > Export > To Python Script.
  2. Name and save the python script.
  3. You must adjust that python script to include ArcFM licensing information. Open an editor, such as Notepad++, and add the following lines to the top of the script:

    #ArcFM licensing

    import win32com.client
    app = win32com.client.Dispatch("Miner.Framework.Dispatch.MMAppInitializeDispatch")
    runtime = win32com.client.Dispatch("Miner.Framework.Dispatch.MMRuntimeEnvironmentDispatch")
    app.Initialize(0x5)
    #end ArcFm licensing
  4. You can now run this script from outside of an ArcMap or ArcCatalog session. To automate the process of exporting this data, you might use the Microsoft Task Scheduler to create a task that runs nightly.
QR code for this page

Was this helpful?