Huella de multiparche (3D Analyst)

Resumen

Crea huellas de polígono que representan el área bidimensional ocupada por una clase de entidad multiparche.

Ilustración

Multipatch Footprint

Uso

Sintaxis

MultipatchFootprint_3d (in_feature_class, out_feature_class)
ParámetroExplicaciónTipo de datos
in_feature_class

La entidad multiparche cuya huella se generará.

Feature Layer
out_feature_class

La clase de entidad poligonal de huella resultante.

Feature Class

Ejemplo de código

Ejemplo 1 de MultipatchFootprint (ventana de Python)

El siguiente ejemplo muestra cómo usar de esta herramienta en la ventana Python:

import arcpy
from arcpy import env

arcpy.CheckOutExtension("3D")
env.workspace = "C:/data"
arcpy.MultiPatchFootprint_3d("multipatch.shp","multipatch_footprint.shp")
Ejemplo 2 de MultipatchFootprint (secuencia de comandos independiente)

El siguiente ejemplo muestra cómo usar esta herramienta en una secuencia de comandos independiente de 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)

Entornos

Temas relacionados

9/11/2013