Intersect 3D Line With Multipatch (3D Analyst)

License Level:BasicStandardAdvanced

Summary

Determines and returns the number of geometric intersections between line and multipatch features. Point features representing the intersection and line features representing the input lines divided at such points can optionally be written to output feature classes.

Illustration

Intersect 3D Line With Multipatch example

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 line features that will be intersected with multipatch features..

Feature Layer
in_multipatch_features

The multipatch features that the lines will be intersected against.

Feature Layer
join_attributes
(Optional)

Defines whether attributes from the input line features will be preserved in the output line feature class.

  • IDS_ONLY No attributes from the input line features will be written to the output line feature class. This is the default.
  • ALLAll attributes from the input line features will be written to the output line feature class.
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 input 3D lines at points of intersection with multipatch features.

Feature Class

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

Related Topics

Licensing Information

ArcGIS for Desktop Basic: Requires 3D Analyst
ArcGIS for Desktop Standard: Requires 3D Analyst
ArcGIS for Desktop Advanced: Requires 3D Analyst
11/8/2012