Summary
Exports feature layers with 3D display properties to 3D lines or multipatch features.
Usage
Feature layers whose symbology has the following properties will be exported to a multipatch:
- Extrusion or base height settings.
- Character marker symbols with depth.
- 3D model marker symbols whose size is denoted in real-world linear units like feet, inches, meters, or centimeters.
- All line symbology.
- All polygon symbology. If a polygon layer is provided without any 3D display properties, it will be exported as a multipatch that resembles the polygon.
Draped layers in ArcGlobe are not supported. Due to the dynamic nature of draped surfaces, height values will not be maintained.
Textured fill symbols are not supported. If a feature in the layer uses 3D marker symbols with restricted properties, like textures, the feature will not be added to the output.
This tool does not support features symbolized with any of the following properties:
- Picture marker symbols.
- Shape marker symbols that come from a file on disk.
- Rasterized layers that are being draped on the scene's surface.
- Shape marker symbols that are sourced from a font but do not have a depth property.
- 3D marker symbols whose size is not specified in real-world linear units like feet, inches, meters or centimeters.
- Marker symbols that are billboarded. The position of these 2D symbols are dynamically oriented to face the camera position in a 3D scene, so they have no fixed orientation that can be used for exporting.
Environment settings for XYZ tolerance and resolution are only supported when the output is a line feature.
Syntax
Layer3DToFeatureClass_3d (in_feature_layer, out_feature_class, {group_field})
Parameter | Explanation | Data Type |
in_feature_layer | The input feature layer with 3D display properties defined. | Feature Layer |
out_feature_class | Extruded points are exported as 3D lines. Points with 3D symbols, extruded lines, and polygons are exported as multipatch features. | Feature Class |
group_field (Optional) | The input feature's text field that will be used to merge multiple input features into the same output feature. The resulting output's remaining attributes will be inherited from one of the input records. | Field |
Code sample
Layer3DToFeatureClass 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.Layer3DToFeatureClass_3d("Points_3D.lyr", "Test.gdb/trees")
Layer3DToFeatureClass example 2 (stand-alone script)
The following sample demonstrates the use of this tool in a stand-alone Python script.
'''****************************************************************************
Name: Layer3DToFeatureClass Example
Description: This script demonstrates how to use the
Layer3DToFeatureClass tool to create multipatches from all
layers in a target workspace. The layer files are assumed to have
been saved wtih 3D rendering from ArcScene.
****************************************************************************'''
# Import system modules
import arcpy
from arcpy import env
import exceptions, sys, traceback
try:
# Obtain a license for the ArcGIS 3D Analyst extension
arcpy.CheckOutExtension("3D")
# Set environment settings
env.workspace = "C:/data"
# Use the ListFiles method to identify all layer files in workspace
if arcpy.ListFiles("*.lyr"):
for lyrFile in arcpy.ListFiles("*.lyr"):
# Set Local Variables
outFC = "Test.gdb/{0}".format(lyrFile[:-4]) #Strips '.lyr' from name
#Execute Layer3DToFeatureClass
arcpy.Layer3DToFeatureClass_3d(file, outFC)
else:
"There are no layer files in {0}.".format(env.workspace)
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
Licensing information
- ArcGIS Desktop Basic: Requires 3D Analyst
- ArcGIS Desktop Standard: Requires 3D Analyst
- ArcGIS Desktop Advanced: Requires 3D Analyst