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

Intersect 3D Line With Multipatch

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

Summary

Returns the number of geometric intersections between 3D line and multipatch features and also provides optional features that represent points of intersection and also divide the 3D lines at such points.

Illustration

Intersect 3D Line With Multipatch example

Usage

  • The intersection count will be returned in the message window and can be used in a model or script to establish preconditions for subsequent operations.

  • This tool determines the points of intersection in 3D Euclidian space. 2D line features are not supported by this tool, but 2D line features with height definitions stored in an attribute field can be converted to 3D by using Feature To 3D By Attribute.

  • The optional point output represents points of intersection between the input line and multipatch features and contains the following attributes:

    • LINE_OID—The OBJECTID of the original line along which the intersection was found.
    • MPATCH_OID—The OBJECTID of the multipatch which intersected the line at this location.
    • DIST_3D—The 3D distance along the original line at which the intersection was found.
  • The optional line output divides input line features at the points of intersection and contains the following attributes:

    • LINE_OID—The OBJECTID of the original line from which the new line was derived.
    • FROM_MP_ID—The OBJECTID of the multipatch feature that intersects the beginning of the line. A value of -1 is used to denote that the beginning of the line is not a point of intersection.
    • TO_MP_ID—The OBJECTID of the multipatch that intersects the end of the line. A value of -1 is used to denote that the beginning of the line is not a point of intersection.
      Note:

      If a line does not intersect with a multipatch, it is directly copied to the output and its FROM_MP_ID and TO_MP_ID fields will contain -1.

    • DIST_3D—The 3D distance along the original line at which an intersection was found and which represents the beginning of this new line.
    • LENGTH_3D—The 3D length of this new line. The sum of the lengths of each new line derived from an original line will be equal to the 3D length of that original line.
  • Attribute values from the original lines can be referenced in the optional output features through the use of output line feature class through the Join Attributes parameter.

Syntax

arcpy.ddd.Intersect3DLineWithMultiPatch(in_line_features, in_multipatch_features, {join_attributes}, {out_point_feature_class}, {out_line_feature_class})
ParameterExplanationData Type
in_line_features

The line features that will be intersected with the multipatch features.

Feature Layer
in_multipatch_features

The multipatch features that the lines will be intersected against.

Feature Layer
join_attributes
(Optional)

The input line feature attributes that will be stored with the optional output features.

  • IDS_ONLY — Only feature identification numbers will be stored. This is the default.
  • ALL —All attributes will be stored.
String
out_point_feature_class
(Optional)

Optional features that represent points of intersection between the 3D line and multipatch.

Feature Class
out_line_feature_class
(Optional)

Optional line features that divide the input lines at each point of intersection with a multipatch feature.

Feature Class

Derived Output

NameExplanationData Type
out_intersection_count

The intersection count.

Long

Code sample

Intersect3DLineWithMultipatch 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.Intersect3DLineWithMultiPatch_3d('inLine.shp', 'inMultipatch.shp', 
                                     'IDS_ONLY', 'outPts.shp', 'outLine.shp')
Intersect3DLineWithMultipatch example 2 (stand-alone script)

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

'''****************************************************************************
Name: Intersect3DLineWithMultiPatch Example
Description: This script demonstrates how to
             use the Intersect3DLine 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
    inLineFC = 'sample.gdb/lines_3d'
    inMP = 'sample.gdb/test_MP'
    # Ensure a unique name is produced for output files
    outPoint = arcpy.CreateUniqueName('OutPt_3DIntersect', 'sample.gdb')
    outLine = arcpy.CreateUniqueName('OutLine_3DIntersect', 'sample.gdb')
    
    # Execute Intersect 3D Line with Multipatch
    arcpy.Intersect3DLineWithMultiPatch_3d(inLineFC, inMP, 'IDS_ONLY', 
                                        outPoint, outLine)

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
  • Z Resolution
  • Z Tolerance
  • Output CONFIG Keyword
  • Auto Commit
  • 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
  • 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