import  arcgisscripting

import  string;

gp = arcgisscripting.create(9.3);

##多少个工具箱

toolboxes = gp.listToolboxes();

for toolbox in toolboxes:

    #截取工具箱的别名

    first = string.find(toolbox,"("); ##第一个'('的索引值

    end = string.find(toolbox,")")    ##最后一个')'的索引值

    toolboxAlias = toolbox[first+1:end]; ##工具箱的别名

    gp.AddMessage(toolboxAlias);

    i = 0;

    tools = gp.listTools();

    for tool in tools:

        f =  string.find(tool,"_"); ##"_"的索引值

        alias = tool[f+1:];

        if alias == toolboxAlias:

            gp.AddMessage( tool);

            i=i+1;

    gp.AddMessage(  "====="+toolbox+"'s count:"+str(i));

gp.AddMessage( "the tool count:"+str( len(tools)));

gp.AddMessage(  "the toolbox count:"+str(len(toolboxes)));

参考:http://bbs.esrichina-bj.cn/ESRI/viewthread.php?tid=85530&highlight=python

相关文章:

  • 2022-03-08
  • 2022-12-23
  • 2022-12-23
  • 2022-01-09
  • 2022-12-23
  • 2022-02-13
  • 2021-12-05
  • 2022-12-23
猜你喜欢
  • 2022-01-14
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-11-27
  • 2022-12-23
  • 2021-10-21
相关资源
相似解决方案