Difference 3D (3D Analyst)

Summary

Eliminates portions of multipatch features in a target feature class that overlap with enclosed volumes of multipatch features in the subtraction feature class.

Illustration

Difference 3D tool illustration

Usage

  • Closed multipatch geometry is required for this analysis. The Is Closed 3D tool can be used to determine if a multipatch feature class contains closed features, and the Enclose Multipatch tool can be used to eliminate gaps in multipatch features.

  • Input features that are fully enclosed by a subtract feature will be completely removed in the output. This tool's processing time can be lengthy, and care should be taken when selecting input datasets.

  • The output features will not have any of the attributes of the input features. If necessary, a spatial join to the source features or a relationship class to the optional output table can be constructed to map attributes from the input features to the output dataset.

  • Textures and colors from the input multipatch features will not be preserved in the output.

Parameters

LabelExplanationData Type
Input Features

The multipatch features that will have features removed by the subtrahend features.

Feature Layer
Subtract Features

The multipatch features that will be subtracted from the input.

Feature Layer
Output Feature Class

The output multipatch feature class that will contain the resulting features.

Feature Class
Output Table
(Optional)

A table that stores information about the relationship between the input features and the difference output. The following fields will be created in this table:

  • Output_ID—The ID of the output feature
  • Minuend_ID—The ID of the input feature
  • Subtrahend—The ID of the subtract feature
Table

arcpy.ddd.Difference3D(in_features_minuend, in_features_subtrahend, out_feature_class, {out_table})
NameExplanationData Type
in_features_minuend

The multipatch features that will have features removed by the subtrahend features.

Feature Layer
in_features_subtrahend

The multipatch features that will be subtracted from the input.

Feature Layer
out_feature_class

The output multipatch feature class that will contain the resulting features.

Feature Class
out_table
(Optional)

A table that stores information about the relationship between the input features and the difference output. The following fields will be created in this table:

  • Output_ID—The ID of the output feature
  • Minuend_ID—The ID of the input feature
  • Subtrahend—The ID of the subtract feature
Table

Code sample

Difference3D example 1 (Python window)

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

arcpy.env.workspace = 'C:/data'
arcpy.Difference3D_3d('input_mp.shp', 'erase_mp.shp', 'difference_mp.shp')
Difference3D example 2 (stand-alone script)

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

'''****************************************************************************
Name: Difference3D Example
Description: This script demonstrates how to create
             shadow volumes that fall along a specified surface using the
             Difference3D tool.
****************************************************************************'''
# Import system modules
import arcpy

# Set environment settings
arcpy.env.workspace = 'C:/data'

# Set Local Variables
inMP = 'buildings.shp'
eraseMP = 'bldg_extensions.shp'
outMP = arcpy.CreateUniqueName('bldgs_without_extensions.shp')

# Execute Difference3D
arcpy.Difference3D_3d(inMP, eraseMP, outMP)

Related topics