ArcGIS Pro 3.7 API Reference Guide
ArcGIS.Core.Geometry Namespace / GeometryEngine Class / ConstructMultipatchExtrudeAlongLine Method
The base geometry.
The from coordinate.
The to coordinate.
Example

In This Topic
    ConstructMultipatchExtrudeAlongLine Method (GeometryEngine)
    In This Topic
    Creates a multipatch from the input polygon or polyline.
    Syntax
    Public Function ConstructMultipatchExtrudeAlongLine( _
       ByVal multipart As Multipart, _
       ByVal fromCoordinate As Coordinate3D, _
       ByVal toCoordinate As Coordinate3D _
    ) As Multipatch
    public Multipatch ConstructMultipatchExtrudeAlongLine( 
       Multipart multipart,
       Coordinate3D fromCoordinate,
       Coordinate3D toCoordinate
    )

    Parameters

    multipart
    The base geometry.
    fromCoordinate
    The from coordinate.
    toCoordinate
    The to coordinate.

    Return Value

    Returns the multipatch.
    Exceptions
    ExceptionDescription
    Geometry is null or empty.
    The geometry is not Z-Aware.
    Remarks
    Creates a multipatch from a base geometry by extruding the base geometry along an axis defined by a fromCoordinate and a toCoordinate. The base Z-values of the geometry are uniformly set to the Z-value of the fromCoordinate and the top Z-values are uniformly set to the Z-value of the toCoordinate. The top geometry is also shifted in the X and Y directions by an offset defined by the X and Y change between the fromCoordinate and the toCoordinate. The resulting extrusion is always parallel to the XY-plane on both the base and the top.
    Example
    Construct Multipatch via Extrusion of Polygon or Polyline
    {
      // build a polygon
      string json = "{\"hasZ\":true,\"rings\":[[[0,0,0],[0,1,0],[1,1,0],[1,0,0],[0,0,0]]],\"spatialReference\":{\"wkid\":4326}}";
      Polygon polygonNew = PolygonBuilderEx.FromJson(json);
    
      // extrude the polygon by an offset to create a multipatch
      multipatch = GeometryEngine.Instance.ConstructMultipatchExtrude(polygon, 2);
    
      // a different polygon
      json = "{\"hasZ\":true,\"rings\":[[[0,0,1],[0,1,2],[1,1,3],[1,0,4],[0,0,1]]],\"spatialReference\":{\"wkid\":4326}}";
      polygon = PolygonBuilderEx.FromJson(json);
    
      // extrude between z values to create a multipatch
      multipatch = GeometryEngine.Instance.ConstructMultipatchExtrudeFromToZ(polygon, -10, 20);
    
      // extrude along the axis defined by the coordinate to create a multipatch
      Coordinate3D coord = new Coordinate3D(10, 18, -10);
      multipatch = GeometryEngine.Instance.ConstructMultipatchExtrudeAlongVector3D(polygon, coord);
    
      // build a polyline
      json = "{\"hasZ\":true,\"paths\":[[[400,800,1000],[800,1400,1500],[1200,800,2000],[1800,1800,2500],[2200,800,3000]]],\"spatialReference\":{\"wkid\":3857}}";
      Polyline polylineNew = PolylineBuilderEx.FromJson(json);
    
      // extrude to a specific z value to create a multipatch
      multipatch = GeometryEngine.Instance.ConstructMultipatchExtrudeToZ(polyline, 500);
    
      Coordinate3D fromCoord = new Coordinate3D(50, 50, -500);
      Coordinate3D toCoord = new Coordinate3D(200, 50, 1000);
    
      // extrude between two coordinates to create a multipatch
      multipatch = GeometryEngine.Instance.ConstructMultipatchExtrudeAlongLine(polyline, fromCoord, toCoord);
    }
    Requirements

    Target Platforms: Windows 11 Home, Pro, Enterprise (64 bit)

    ArcGIS Pro version: 3.0 or higher.
    See Also