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
-
A multipatch feature class and a 3D line feature class are required as input.
The tool will determine the intersection between every selected line (or all lines, if none is selected) in the input line feature class, and every selected multipatch (or all multipatches, if none is selected) in the input multipatch feature class.
-
Attribute values from the input line features are optionally carried across to the optional output line feature class.
The tool also generates a numeric (integer) output, giving the number of points of intersection found, even if no output feature class is specified.
Either, neither, or both of the output feature classes may be specified (i.e. point and/or line or neither). Neither is only used when using a model or script and using the output intersection count.
Multipatches do not have to be closed.
The output features have three-dimensional geometry.
-
The following fields are present in the optional output point feature class:
- OID: The OBJECTID of the point.
- Shape: The geometry of the point.
- 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 following fields are present in the optional output line feature class:
- OID: The OBJECTID of the point.
- Shape: The geometry of the line.
- LINE_OID: The OBJECTID of the original line along which the intersection was found, and from which this new line was spawned.
- FROM_MP_ID: The OBJECTID of the multipatch which intersected the original line at the beginning of this new line (-1 if no multipatch).
- TO_MP_ID: The OBJECTID of the multipatch which intersected the original line at the end of this new line (-1 if no multipatch).
- 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.
Intersect 3D Line With Multipatch is a 3D set operator as part of the 3D Features toolset. See Working with 3D set operators for more information on what set operators are and how to use them.
Syntax
Parameter | Explanation | Data 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.
| 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
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')
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)