Okay,
I have tried a few options based upon what I could find online, however I am still getting errors when I try to import and run an XTools Pro tool in python. Everything works fine when I run it as a python script attached to a model in model builder or simply run it directly as a stand alone python script in ArcGIS Desktop.
Yes, it is licensed, etc.
Here is the code I am currently trying:
I have also dragged the Export2Excel tool into a model and export it resulting in the following code:
Any suggestions?
Any chance this is a 32 vs 64 bit issue?
I am using ArcGIS 10.2.
Thanks
I have tried a few options based upon what I could find online, however I am still getting errors when I try to import and run an XTools Pro tool in python. Everything works fine when I run it as a python script attached to a model in model builder or simply run it directly as a stand alone python script in ArcGIS Desktop.
Yes, it is licensed, etc.
Here is the code I am currently trying:
Code:
xlsxPath = reportFolder+"earthquakeReport.xlsx"
xlsxDatedReport = reportFolderDated+"earthquakeReport_{}.xlsx".format(datetime.strftime(datetime.now(),"%Y-%m-%d_%H%M"))
xList = "DATE;MAGNITUDE;EPICENTER"
arcpy.ImportToolbox("C:/Program Files (x86)/DataEast/XTools Pro/Toolbox/XTools Pro.tbx")
arcpy.gp.XToolsGP_Export2Excel(eqPoliciesFC,xList,xlsxPath)
# error = "pythonw.exe has stopped working"
arcpy.XToolsPro_Export2Excel(eqPoliciesFC,xList,xlsxPath)
# error = <type 'exceptions.AttributeError'>: 'module' object has no attribute 'XToolsPro_Export2Excel'
I have also dragged the Export2Excel tool into a model and export it resulting in the following code:
Code:
# Import arcpy module
import arcpy
# Load required toolboxes
arcpy.ImportToolbox("C:/Program Files (x86)/DataEast/XTools Pro/Toolbox/XTools Pro.tbx")
# Local variables:
eqPolicies = "C:\\arcgisserver\\gisData\\services\\eqMap\\data\\eqMap.gdb\\eqPolicies"
excelTest_xlsx = "C:\\arcgisserver\\gisData\\services\\eqMap\\data\\excelTest.xlsx"
# Process: Export Table to MS Excel
arcpy.gp.toolbox = "C:/Program Files (x86)/DataEast/XTools Pro/Toolbox/XTools Pro.tbx";
arcpy.XToolsGP_Export2Excel_eqMapAnalysis(eqPolicies, "DATE;MAGNITUDE;EPICENTER", excelTest_xlsx, "true")
Any suggestions?
Any chance this is a 32 vs 64 bit issue?
I am using ArcGIS 10.2.
Thanks