AnsweredAssumed Answered

Troubles Importing XTools Pro Tools In Python

Question asked by geohaskett on Jan 29, 2014
Latest reply on Jan 31, 2014 by Caleb1987

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:

xlsxPath = reportFolder+"earthquakeReport.xlsx" xlsxDatedReport = reportFolderDated+"earthquakeReport_{}.xlsx".format(datetime.strftime(,"%Y-%m-%d_%H%M")) xList = "DATE;MAGNITUDE;EPICENTER"  arcpy.ImportToolbox("C:/Program Files (x86)/DataEast/XTools Pro/Toolbox/XTools Pro.tbx"),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:

# 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 = "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.