Arcpy基础方法之Tools&Toolboxes
1.引入自定义的工具箱
c:\python
>>>import arcpy
>>>arcpy.ImportToolbox("c:/PCovertL.tbx")
2.List工具箱中访问工具的方法
1)列出所有工具箱,查看别名
c:\python
>>>import arcpy
>>> toolboxList=arcpy.ListToolboxes()
>>> for toolbox in toolboxList:
... print toolbox
...
3D Analyst Tools(3d)
Analysis Tools(analysis)
Cartography Tools(cartography)
Conversion Tools(conversion)
Data Interoperability Tools(interop)
Data Management Tools(management)
Editing Tools(edit)
Geocoding Tools(geocoding)
Geostatistical Analyst Tools(ga)
Linear Referencing Tools(lr)
Multidimension Tools(md)
Network Analyst Tools(na)
Parcel Fabric Tools(fabric)
Samples(samples)
Schematics Tools(schematics)
Server Tools(server)
Spatial Analyst Tools(sa)
Spatial Statistics Tools(stats)
Tracking Analyst Tools(ta)
Coverage Tools(arc)
P_Covert_L(PTL)
(自定义工具箱,最后在工具箱建立之初建立别名
作用:方便查出import自定义工具箱的工具访问方法,arcpy.ListTools(“*_PTL”))
2)列出某类工具箱下工具的访问方法
>>> arcpy.ListTools("*_ta")
[u'ConcatenateDateAndTimeFields_ta', u'MakeTrackingLayer_ta']
3)列出所有工具箱下工具的访问方法与参数
>>>toolList=arcpy.ListTools()
>>>for tool in toolList:
>>> print tool
>>> print arcpy.Usage(tool)
Script(加{}表示为非必填项)
Script(Input_Features, Output_Feature_Class, {Line_Field}, {Sort_Field}, {Close_Line})
转载自:https://blog.csdn.net/gisinfo/article/details/6659794