For example, I have a custom tool "wellTabletoFC". When I pull up the Item Description, it gives me a syntax as if it can be used within the console:
wellTabletoFC(Input_Table)
When I drag the script into the Python window, I get this code:
>>> arcpy.wellTabletoFC()
Runtime error
Traceback (most recent call last):
File "<string>", line 1, in <module>
AttributeError: 'module' object has no attribute 'wellTabletoFC'
How do I use my own tools in the same way as ArcGIS tools within ArcPy, for example:
arcpy.Project_management(
in_dataset,
out_dataset,
out_coor_system,
transform_method,
{in_coor_system},
{preserve_shape},
{max_deviation},
{vertical}
)
I want to do this for 2 reasons:
- Run the tool within the Python console, while being able to return the tool output into a variable,
- Chain multiple custom tools together that are maintained separately, into a single workflow
If it's a script tool in a toolbox, you can import the toolbox and script tool:
Adding toolboxes in Python—Geoprocessing and Python | ArcGIS Desktop