ArcGIS Pro 3.3 API Reference Guide
ArcGIS.Core.Geometry Namespace / MultipatchBuilderEx Class / FromEsriShape Method
Esri shape buffer representation of Multipatch.
(Optional)The spatial reference of the Multipatch.
Example

In This Topic
    FromEsriShape Method (MultipatchBuilderEx)
    In This Topic
    Creates a new instance of a Multipatch class from an Esri shape buffer.
    Syntax
    Public Shared Function FromEsriShape( _
       ByVal esriShapeBuffer() As Byte, _
       Optional ByVal spatialReference As SpatialReference _
    ) As Multipatch

    Parameters

    esriShapeBuffer
    Esri shape buffer representation of Multipatch.
    spatialReference
    (Optional)The spatial reference of the Multipatch.

    Return Value

    Exceptions
    ExceptionDescription
    The esriShapeBuffer is empty or null.
    The Esri shape buffer is invalid or does not represent a multipatch.
    Example
    Construct Multipatch
    // export to binary xml
    string binaryXml = multiPatch.ToBinaryXml();
    
    // import from binaryXML - methods need to run on the MCT
    Multipatch binaryMultipatch = MultipatchBuilderEx.FromBinaryXml(binaryXml);
    
    // xml export / import
    string xml = multiPatch.ToXml();
    Multipatch xmlMultipatch = MultipatchBuilderEx.FromXml(xml);
    
    // esriShape export/import
    byte[] buffer = multiPatch.ToEsriShape();
    Multipatch esriPatch = MultipatchBuilderEx.FromEsriShape(buffer);
    
    // or use GeometryEngine
    Multipatch patchImport = GeometryEngine.Instance.ImportFromEsriShape(EsriShapeImportFlags.EsriShapeImportDefaults, buffer, multiPatch.SpatialReference) as Multipatch;
    
    Requirements

    Target Platforms: Windows 11, Windows 10

    ArcGIS Pro version: 3 or higher.
    See Also