Hi all,
I'm trying to get the Z-value of the intersection point between a 3D polyline (i.e., a vertical ray) and a Multipatch feature using the ArcGIS Pro SDK (GeometryEngine.Instance.Intersection), but it seems I'm unable to get a valid result.
What I’ve tried:
- I created a Multipatch feature using Layer 3D To Feature Class. The shape has varying Z values (e.g., west side at 10 meters, east side at 10,000 meters), confirmed via inspection.
- I constructed a 3D polyline (ray) that vertically spans from Z = -10,000 to Z = +10,000 through a known XY coordinate within the Multipatch's extent.
- I verified that GeometryEngine.Instance.Intersects(multipatch, ray) returns true.
- However, calling GeometryEngine.Instance.Intersection(multipatch, ray, GeometryDimensionType.EsriGeometry0Dimension) returns an empty geometry.
- I also tried EsriGeometry1Dimension and even the overload without specifying the dimension — in some cases I got a Polyline or Multipoint, but none of the returned geometries had valid Z values (Z = NaN).
- Trying EsriGeometry3Dimension throws an exception: Value does not fall within the expected range.
My question:
- Is it possible to obtain the correct Z-value of the intersection point between a 3D polyline and a Multipatch using only GeometryEngine in ArcGIS Pro SDK?
- Or is the only reliable way to do this via the “Intersect 3D Line With Multipatch” geoprocessing tool (which requires the 3D Analyst extension)?
- If anyone has an SDK-only workaround (e.g., ray-triangle intersection manually on the Multipatch), I’d be happy to hear it.
Thanks in advance!