Custom import/export tool created with the Data Interoperability extension runs sucessfully from Python, but when added in as a script tool in ArcToolbox, it fails because it does not recognize the Spatial ETL tool.
上次发布: August 25, 2014No Product Found
漏洞 ID 编号
NIM006088
已提交
January 16, 2007
上次修改时间
June 5, 2024
适用范围
No Product Found
找到的版本
9.2
修正版本
9.3
状态
Fixed
此漏洞已得到修复。 有关详细信息,请参阅“版本修复”和“其他信息”(如果适用)。
解决办法
The only workaround I have seen at this point is with Pythons spawnv method.# Main scriptimport arcgisscripting, os, sysgp = arcgisscripting.create()#you will need to set the correct path information to python.exe on your machinepythonPath = '<a href="file:C://Python24//python.exe'" target="_blank">C:\\Python24\\python.exe'</a>#Reference to the second scriptETL = '<a href="file:C://Incidents//Active//540203//SpawnTest//ETL_Tool.py'" target="_blank">C:\\Incidents\\Active\\540203\\SpawnTest\\ETL_Tool.py'</a># just an example of passing messages between the two scriptsname = sys.argv[1]#create a list for the parameters for the second script parameterList = []parameterList.append('python.exe')parameterList.append(ETL)parameterList.append(name)#run the second script in a new instance of python and populate the scripts parameters with the appropriate values os.spawnv(os.P_WAIT, pythonPath, parameterList)print "End of script"del gp#########################################script called from spawnvimport os, sys, arcgisscripting# Create the geoprocessor object.# The memory used by this process will clear as soon as the process is completedgp = arcgisscripting.create()#Gets the values from the first scriptname = sys.argv[1]print "Got the correct name: " + name# Load required toolboxes...gp.AddToolbox("C:/Documents and Settings/john4818/Application Data/ESRI/ArcToolbox/My Toolboxes/ETL.tbx")#gp.setproduct("ArcView")#gp.setproduct("ArcEditor")# Local variables...test3_dwg = "<a href="file:C://Incidents//Active//540203//test22.dwg" target="_blank">C:\\Incidents\\Active\\540203\\test22.dwg</a>"New_Personal_Geodatabase_mdb = "<a href="file:C://Incidents//Active//540203//New" target="_blank">C:\\Incidents\\Active\\540203\\New</a> Personal Geodatabase.mdb"gp.Toolbox = "C:/Documents and Settings/john4818/Application Data/ESRI/ArcToolbox/My Toolboxes/ETL.tbx"# Process: Spatial ETL Tool...gp.SpatialETLTool("'<a href="file:C://Incidents//Active//540203//New" target="_blank">C:\\Incidents\\Active\\540203\\New</a> Personal Geodatabase.mdb'", test3_dwg)del gp