Listing tools and environments

About lising tools and environments

When you initialize the geoprocessor in your program, you have access to all the tools contained in your system toolboxes and you can have your custom toolboxes added. Thus, you may have access to hundreds of tools. The geoprocessor has several appropriately named methods to return a list of tools (ListTools) and environments (ListEnvironments).
Each method has a wildcard option and can return a IGpEnumList of strings that can be looped through. The following code example lists tools and environments:
// List all tools containing the name Clip.
IGpEnumList toolList = gp.listTools("*clip");
String toolName =;
while (!"" .equals(toolName)){
    toolName =;

// List all environment names.
IGpEnumList envList = gp.listEnvironments("*");
String envName =;
while (!"" .equals(envName)){
    envName =;