多面体(Multipatch)轮廓线 (3D Analyst)
摘要
创建表示由多面体要素类占据的二维区域的面轮廓线。
插图
用法
-
多面体要素中高程值的范围归因于输出要素类中的 Z_MIN 和 Z_MAX 字段。
语法
MultipatchFootprint_3d (in_feature_class, out_feature_class)
参数 | 说明 | 数据类型 |
in_feature_class |
将要生成覆盖区的多面体要素。 | Feature Layer |
out_feature_class |
生成的覆盖区面要素类。 | Feature Class |
代码实例
MultipatchFootprint 示例 1(Python 窗口)
下面的示例演示了如何在 Python 窗口中使用此工具:
import arcpy
from arcpy import env
arcpy.CheckOutExtension("3D")
env.workspace = "C:/data"
arcpy.MultiPatchFootprint_3d("multipatch.shp","multipatch_footprint.shp")
MultipatchFootprint 示例 2(独立脚本)
下面的示例演示了如何在独立 Python 脚本中使用此工具:
'''****************************************************************************
Name: MultiPatchFootprint Example
Description: Creates footprint polygons for all multipatches in a workspace.
****************************************************************************'''
import arcpy
import exceptions, sys, traceback
from arcpy import env
try:
arcpy.CheckOutExtension('3D')
# Set environment settings
env.workspace = 'C:/data'
fcList = arcpy.ListFeatureClasses()
if fcList:
for fc in fcList:
# Determine if the feature class is a multipatch
desc = arcpy.Describe(fc)
if desc.shapeType is "MultiPatch":
outPoly = "{0}_Footprint.shp".format(desc.baseName)
#Execute MultiPatchFootprint
arcpy.ddd.MultiPatchFootprint(fc, outPoly)
arcpy.CheckInExtension('3D')
except arcpy.ExecuteError:
print arcpy.GetMessages()
except:
# Get the traceback object
tb = sys.exc_info()[2]
tbinfo = traceback.format_tb(tb)[0]
# Concatenate error information into message string
pymsg = 'PYTHON ERRORS:\nTraceback info:\n{0}\nError Info:\n{1}'\
.format(tbinfo, str(sys.exc_info()[1]))
msgs = 'ArcPy ERRORS:\n {0}\n'.format(arcpy.GetMessages(2))
# Return python error messages for script tool or Python Window
arcpy.AddError(pymsg)
arcpy.AddError(msgs)
环境
相关主题
许可信息
ArcGIS for Desktop Basic: 需要 3D Analyst
ArcGIS for Desktop Standard: 需要 3D Analyst
ArcGIS for Desktop Advanced: 需要 3D Analyst
5/10/2014