Emprise de multipatch (3D Analyst)

Récapitulatif

Crée des emprises de polygone représentant la surface bidimensionnelle occupée par une classe d'entités multipatch.

Illustration

Emprise de multipatch

Utilisation

Syntaxe

MultipatchFootprint_3d (in_feature_class, out_feature_class)
ParamètreExplicationType de données
in_feature_class

Entité multipatch pour laquelle une emprise est générée.

Feature Layer
out_feature_class

Classe d'entités surfaciques d'emprise obtenue

Feature Class

Exemple de code

1er exemple d'utilisation de l'outil MultipatchFootprint (fenêtre Python)

The following sample demonstrates the use of this tool in the Python window:

import arcpy
from arcpy import env

arcpy.CheckOutExtension("3D")
env.workspace = "C:/data"
arcpy.MultiPatchFootprint_3d("multipatch.shp","multipatch_footprint.shp")
2e exemple d'utilisation de l'outil MultipatchFootprint (script autonome)

The following sample demonstrates the use of this tool in a stand-alone Python script:

'''****************************************************************************
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)

Environnements

Rubriques connexes

Informations de licence

ArcView : Obligatoire 3D Analyst
ArcEditor : Obligatoire 3D Analyst
ArcInfo : Obligatoire 3D Analyst

7/10/2012