是否为闭合 3D (3D Analyst)
摘要
评估多面体要素以确定是否每个要素完全封闭空间体积。
用法
指定多面体是否闭合的新字段被添加到输入多面体要素。
此工具是提供针对 3D 要素的分析函数的 3D 集合运算符。有关什么是集合运算符以及如何使用它们的详细信息,请参阅使用 3D 集合运算符。
语法
IsClosed3D_3d (in_feature_class)
参数 | 说明 | 数据类型 |
in_feature_class |
要测试的多面体要素。 | Feature Layer |
代码实例
IsClosed 示例 1(Python 窗口)
下面的示例演示了如何在 Python 窗口中使用此工具:
import arcpy
from arcpy import env
env.workspace = 'C:/data'
arcpy.IsClosed3D_3d('sample_multipatch.shp')
IsClosed 示例 2(独立脚本)
下面的示例演示了如何在独立 Python 脚本中使用此工具:
'''****************************************************************************
Name: IsClosed3D Example
Description: This script demonstrates how to use the
IsClosed3D tool on all multipatches in a target workspace.
****************************************************************************'''
# Import system modules
import arcpy
import exceptions, sys, traceback
from arcpy import env
try:
# Obtain a license for the ArcGIS 3D Analyst extension
arcpy.CheckOutExtension('3D')
# Set environment settings
env.workspace = 'C:/data'
# Set Local Variables
for fc in arcpy.ListFeatureClasses(): # list features in workspace
# Determine which features are multipatches
if arcpy.Describe(fc).shapeType == 'MultiPatch':
# Execute Is Closed 3D
arcpy.IsClosed3D_3d(fc)
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