Using AML with script tools

This topic applies to ArcInfo only.

It's possible to use ARC Macro Language (AML) files in the ArcGIS Desktop environment by creating a new geoprocessing script tool. If you have an ArcInfo license and ArcInfo Workstation installed, you can add a custom script tool that references an AML.

There is an initial step that must be completed before an AML file can be set up as a script tool. The system must be able to open ArcInfo Workstation and run the &run command, such as arc: &run MyAml.aml. ESRI provides a tool for updating the system registry. After the system registry has been updated, add a new script tool using the Add Script Tool dialog wizard. The script tool can be used like any other geoprocessing tool.

NoteNote:

Any limitations in ArcInfo Workstation or Workstation modules, such as GRID or TIN, will still be present when running an AML file as a script tool.

Learn more about Python equivalents to AML functions

Steps:
  1. Update the system registry:
    1. Browse to ArcToolbox\Scripts subfolder under your ArcGIS install.
    2. Double-click the file RegisterAmlAsExecutable.reg.
    3. Click Yes to add this information to the registry.
  2. Create a script tool that runs an AML file:
    1. From within ArcGIS, right-click a folder or geodatabase and click New > Toolbox.
    2. Right-click the toolbox created in the previous step, click Add > Script. This starts the Add Script wizard.
    3. Name and describe the new script tool and click Next.
    4. Browse to the location of the AML file and click Next.
    5. Set up the input and output parameters and options and click Finish.
  3. NoteNote:

    AML files that are run as script tools must begin with an Arc: prompt command. It is possible to run commands from other prompts within ArcInfo Workstation, such as GRID, TABLES, ArcPlot, ArcEdit, and so on, but the AML file must start at the Arc: prompt. For example, if the AML file only runs in GRID, be sure to add a line in the AML file that starts GRID before running the rest of the program.

Related Topics


4/14/2011