Intersect 3D Line With Multipatch (3D Analyst)

Summary

Computes a geometric intersection of the input line and multipatch features, and returns the number of points of intersection. Points (of intersection) and/or lines (resulting from input lines being broken at intersection points) can optionally be written to output feature class(es).

Learn more about how Intersect 3D Line With Multipatch (3D Analyst) works

Illustration

Usage

Syntax

Intersect3DLineWithMultiPatch_3d (in_line_features, in_multipatch_features, {join_attributes}, {out_point_feature_class}, {out_line_feature_class})
ParameterExplanationData Type
in_line_features

The input line feature class or layer.

Feature Layer
in_multipatch_features

The input multipatch feature class or layer.

Feature Layer
join_attributes
(Optional)

Allows all nonrequired fields (in other words, not ObjectID or geometry) and values from the input line feature class to be copied into the optional output line feature class.

  • IDS_ONLY No attributes from the input line feature class will be written to the output line feature class. This is the default.
  • ALLAll attributes from the input line feature class will be written to the output line feature class.
String
out_point_feature_class
(Optional)

The optional feature class into which points of intersection will be placed.

Feature Class
out_line_feature_class
(Optional)

The optional feature class into which lines (input lines broken at points of intersection) will be placed.

Feature Class

Code Sample

Intersect 3D Line With Multipatch Example 1 (Python window)

The following Python Window script demonstrates how to use the Intersect 3D Line With Multipatch function in immediate mode.

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')
Intersect 3D Line With Multipatch Example 2 (stand-alone script)

The following Python script demonstrates how to use the Intersect 3D Line With Multipatch function in a stand-alone 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

Related Topics

Licensing Information

ArcView: Requires 3D Analyst
ArcEditor: Requires 3D Analyst
ArcInfo: Requires 3D Analyst

6/10/2013