ArcGIS Desktop

  • ArcGIS Pro
  • ArcMap

  • My Profile
  • Hilfe
  • Sign Out
ArcGIS Desktop

ArcGIS Online

Die Mapping-Plattform für Ihre Organisation

ArcGIS Desktop

Ein vollständiges professionelles GIS

ArcGIS Enterprise

GIS in Ihrem Unternehmen

ArcGIS Developers

Werkzeuge zum Erstellen standortbezogener Apps

ArcGIS Solutions

Kostenlose Karten- und App-Vorlagen für Ihre Branche

ArcGIS Marketplace

Rufen Sie Apps und Daten für Ihre Organisation ab.

  • Dokumentation
  • Support
Esri
  • Anmelden
user
  • Eigenes Profil
  • Abmelden

ArcMap

  • Startseite
  • Erste Schritte
  • Karte
  • Analysieren
  • Verwalten von Daten
  • Werkzeuge
  • Erweiterungen

CreateObject

  • Zusammenfassung
  • Auswertung
  • Syntax
  • Codebeispiel

Zusammenfassung

Creates geoprocessing objects. The extra arguments can be used to specify additional requirements for the object creation such as the number of columns in the ValueTable object.

Auswertung

Hinweis:

Instead of using CreateObject, it is simpler and more direct to use the equivalent ArcPy class. For instance, instead of arcpy.CreateObject("array"), use arcpy.Array().

  • ArcSDESQLExecute
  • Array
  • Extent
  • FeatureSet
  • Field
  • FieldInfo
  • FieldMap
  • FieldMappings
  • Geometry
  • NetCDFFileProperties
  • Point
  • RecordSet
  • Result
  • SpatialReference
  • ValueTable

Syntax

CreateObject (name, {options})
ParameterErklärungDatentyp
name

Name of the object to be created (ArcSDESQLExecute, Array, Extent, FeatureSet, Field, FieldInfo, FieldMap, FieldMappings, Geometry, NetCDFFileProperties, Point, RecordSet, Result, SpatialReference, ValueTable).

String
options

Optional argument(s) depend on the object being created.

Object

Rückgabewert

DatentypErklärung
Object

The object returned depends on type of object specified in the first parameter.

Codebeispiel

CreateObject example

Use value table to hold feature class names and ranks for the Union tool.

import arcpy

# Set the workspace. List all of the feature classes in the dataset
arcpy.env.workspace = "c:/data/landbase.gdb/wetlands"
fcs = arcpy.ListFeatureClasses()

# Create the value table for the Analysis Union tool with 2 columns
vtab = arcpy.CreateObject("valuetable", 2)

# Iterate through the list of feature classes
for fc in fcs:
    # Update the value table with a rank of 2 for each record, except
    #   for BigBog
    if fc.lower() != "bigbog":
        vtab.addRow(fc + " 2")
    else:
        vtab.addRow(fc + " 1")

# Union the wetlands feature classes with the land use feature class
# to create a single feature class with all of the wetlands and land
# use data
vtab.addRow("c:/data/landbase.gdb/land_use 2")
arcpy.Union_analysis(vtab, "c:/data/landbase.gdb/wetlands_use")

Verwandte Themen

  • Verwenden von Klassen in Python

ArcGIS Desktop

  • Startseite
  • Dokumentation
  • Support

ArcGIS

  • ArcGIS Online
  • ArcGIS Desktop
  • ArcGIS Enterprise
  • ArcGIS
  • ArcGIS Developer
  • ArcGIS Solutions
  • ArcGIS Marketplace

Über Esri

  • Über uns
  • Karriere
  • Esri Blog
  • User Conference
  • Developer Summit
Esri
Wir sind an Ihrer Meinung interessiert.
Copyright © 2021 Esri. | Datenschutz | Rechtliches