首页 > 其他 > 详细

ArcGIS Pro 获得工具的个数

时间:2018-12-26 22:15:58      阅读:324      评论:0      收藏:0      [点我收藏+]
import  arcgisscripting

import  string;

gp = arcgisscripting.create(9.3);

##多少个工具箱

toolboxes = gp.listToolboxes();

for toolbox in toolboxes:

    #截取工具箱的别名

    first = toolbox.index("("); ##第一个‘(‘的索引值

    end = toolbox.index(")")    ##最后一个‘)‘的索引值

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

    gp.AddMessage(toolboxAlias);

    i = 0;

    tools = gp.listTools();

    for tool in tools:

        f =  tool.index("_"); ##"_"的索引值

        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)));

=====Space Time Pattern Mining Tools(stpm)‘s count:7
the tool count:894
the toolbox count:23
Completed script Script...

ArcGIS Pro 获得工具的个数

原文:https://www.cnblogs.com/gisoracle/p/10181918.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!