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 insights?
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()
Traceback (most recent call last): File "D:\Milsoft\WindMilMap\WindMilMapExport\WindmillExportAutomation.py", line 11, in <module> arcpy.ElectricWMtoGDB_WindMilAutomation() File "D:\Milsoft\WindMilMap\WindMilMapExport\WindmilAutomation.tbx", line 21, in ElectricWMtoGDB F e a t u r e L a y e r ExecuteError: Failed to execute. Parameters not valid. The value does not exist. WARNING 000258: Output D:\Milsoft\WindMilMap\WindMilMapExport\Electric.gdb already exists ERROR 000732: Input Features: Dataset 'D:\Milsoft\WindMilMap\WindMilMapExport\WindMilMap LLM E-CMS.wm\Capacitor' does not exist or is not supported Failed to execute (ElectricWMtoGDB).