Run model in MXD using Python

1989
0
02-08-2016 08:03 AM
JosephSepulveda
New Contributor

I'm very new to python so please bear with me. I am trying to run a model that exports a .wm feature to a geodatabase feature class. The .wm file extension is for software that is used to update electrical utility data. The model has to be run in an .mxd because the .mxd contains an add-on that allows arcmap to read the .wm files. I'm having a problem getting the script to run successfully because it is not recognizing the .wm file even though the .mxd is open with the add-on enabled. Is there a way to prompt the model to run from the mxd rather than separately? Below is my script. Any incite would be much appreciated. Thanks in advance!

import os

import arcpy

mxd = (r"D:\Milsoft\WindMilMap\WindmilMapExport\WindmilMapExport.mxd")

os.startfile(mxd)

import time

time.sleep(50)

import arcpy

arcpy.ImportToolbox(r"D:\Milsoft\WindMilMap\WindmilMapExport\WindmilAutomation.tbx", "WindmilAutomation")

arcpy.ElectricWMtoGDB_WindmilAutomation()

RESULT:

0 Kudos
0 Replies