ArcGIS Desktop

  • ArcGIS Pro
  • ArcMap

  • My Profile
  • Help
  • Sign Out
ArcGIS Desktop

ArcGIS Online

The mapping platform for your organization

ArcGIS Desktop

A complete professional GIS

ArcGIS Enterprise

GIS in your enterprise

ArcGIS Developers

Tools to build location-aware apps

ArcGIS Solutions

Free template maps and apps for your industry

ArcGIS Marketplace

Get apps and data for your organization

  • Documentation
  • Support
Esri
  • Sign In
user
  • My Profile
  • Sign Out

ArcMap

  • Home
  • Get Started
  • Map
  • Analyze
  • Manage Data
  • Tools
  • Extensions

Feature To 3D By Attribute

  • Summary
  • Usage
  • Syntax
  • Code sample
  • Environments
  • Licensing information

Summary

Creates 3D features using height values derived from the attribute of the input features.

Usage

  • Supports point, multipoint, line, and polygon geometries.

  • Each feature's elevation will be derived from the value obtained in the specified height field. Line features can optionally provide a second height field. Using two height fields will result in each line feature starting from the Z-value obtained in the first height field and ending at the Z-value from the second height field. The heights for any intermediate vertices will be interpolated based on the slope of the line between the two endpoints.

Syntax

arcpy.ddd.FeatureTo3DByAttribute(in_features, out_feature_class, height_field, {to_height_field})
ParameterExplanationData Type
in_features

The features that will be used to create 3D features.

Feature Layer
out_feature_class

The feature class that will be produced by this tool.

Feature Class
height_field

The field whose values will define the height of the resulting 3D features.

Field
to_height_field
(Optional)

An optional second height field used for lines. When using two height fields, each line will start at the first height and end at the second (sloped).

Field

Code sample

FeatureTo3DByAttribute example 1 (Python window)

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.FeatureTo3DByAttribute_3d('Points2D.shp', 'Points3D.shp', 'Elevation')
FeatureTo3DByAttribute example 2 (stand-alone script)

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

'''****************************************************************************
Name: FeatureTo3DByAttribute Example
Description: This script demonstrates how to use the
             FeatureTo3DByAttribute tool.
****************************************************************************'''
# 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
    InFC = 'Points_2D.shp'
    Height_Field = 'POPULATION'
    # Ensure output has unique name
    OutFC = arcpy.CreateUniqueName('Points_3D.shp')
    # Execute ConstructSightLines
    arcpy.FeatureTo3DByAttribute_3d(InFC, OutFC, Height_Field)

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)

Environments

  • Current Workspace
  • Extent
  • Output Coordinate System
  • Geographic Transformations
  • XY Resolution
  • XY Tolerance
  • Default Output Z Value
  • Z Resolution
  • Z Tolerance
  • Output CONFIG Keyword
  • Output XY Domain
  • Output Z Domain

Licensing information

  • Basic: Requires 3D Analyst
  • Standard: Requires 3D Analyst
  • Advanced: Requires 3D Analyst

Related topics

  • An overview of the 3D Features toolset
  • About 3D features
  • Fundamentals of geoprocessing with the ArcGIS 3D Analyst extension

ArcGIS Desktop

  • Home
  • Documentation
  • Support

ArcGIS

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

About Esri

  • About Us
  • Careers
  • Esri Blog
  • User Conference
  • Developer Summit
Esri
Tell us what you think.
Copyright © 2021 Esri. | Privacy | Legal