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

Difference 3D

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

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

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 execution can be very time consuming, 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.

  • This tool is a 3D set operator that provides analytical functions on 3D features. See Working with 3D set operators for more information on what set operators are and how to use them.

Syntax

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

The multipatch features that will have its 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)

An optional table that stores information about the relationship between the input features and the difference output. The following fields are present 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.

import arcpy
from arcpy import env

arcpy.CheckOutExtension('3D')
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
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
    inMP = 'buildings.shp'
    eraseMP = 'bldg_extensions.shp'
    outMP = arcpy.CreateUniqueName('bldgs_without_extensions.shp')
    # Execute Difference3D
    arcpy.Difference3D_3d(inMP, eraseMP, outMP)

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
  • Output XY Domain
  • Output Z Domain
  • Output CONFIG Keyword
  • Auto Commit

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
  • Working with 3D set operators
  • How to import an existing 3D model into a multipatch feature class
  • Multipatches
  • Import 3D Files

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