I have a custom made Toolbox and I can't make it run.
The Toolbox is called toolbox_k
and the tool is called sn
I did this:
arcpy.ImportToolbox(r"C:\Users\user\Desktop\VST\Toolbox_k.tbx", "sn")
I use the sn
with the parameters as using the GUI version and it doesn't work. It gives a syntax error:
sn('pathone','pathtwo')
UPDATE
Running:
>>> arcpy.ImportToolbox("Toolbox_PS.tbx", "tbxk")
gives:
Runtime error
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "c:\program files (x86)\arcgis\desktop10.6\arcpy\arcpy\__init__.py", line 125, in ImportToolbox
return import_toolbox(input_file, module_name)
File "c:\program files (x86)\arcgis\desktop10.6\arcpy\arcpy\toolbox_code.py", line 457, in import_toolbox
mymodule = generate_toolbox_module(toolbox, None, False, False, False, module_name, use_alt_alias)
File "c:\program files (x86)\arcgis\desktop10.6\arcpy\arcpy\toolbox_code.py", line 432, in generate_toolbox_module
'exec')
File "C:\Users\user\Desktop\VST\Toolbox_k.tbx", line 19
def 00CalculateKAEK(PST=None):
^
SyntaxError: invalid syntax
arcpy.toolbox_tool
Syntax error
.