AnsweredAssumed Answered

ArcPy - How do I run custom script tools within the console?

Question asked by msandersAMR on Jan 12, 2018
Latest reply on Jan 12, 2018 by msandersAMR

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:

  1. Run the tool within the Python console, while being able to return the tool output into a variable,
  2. Chain multiple custom tools together that are maintained separately, into a single workflow

Outcomes