ArcGIS Pro 3.3 API Reference Guide
ArcGIS.Core.Geometry Namespace / MultipatchBuilderEx Class / CreateMultipatch Method / CreateMultipatch(MultipatchConstructType,MapPoint,Double,Double,SpatialReference) Method
The type of multipatch to be constructed.
The center point of the Multipatch.
The size of the shape (height, length, width). It must be greater than 0.
A value between 0 and 1 inclusive. A higher quality number means more verticies for the shape resulting in a smoother shape.
(Optional)The spatial reference of the Multipatch.
Example

In This Topic
    CreateMultipatch(MultipatchConstructType,MapPoint,Double,Double,SpatialReference) Method
    In This Topic
    Convenience method to quickly create a new Multipatch object. Use this constructor to create a cylinder, sphere, sphere frame or cone centered around the centerPt of the specified size and quality.
    Syntax
    Public Overloads Shared Function CreateMultipatch( _
       ByVal constructType As MultipatchConstructType, _
       ByVal centerPt As MapPoint, _
       ByVal size As Double, _
       ByVal quality As Double, _
       Optional ByVal spatialReference As SpatialReference _
    ) As Multipatch

    Parameters

    constructType
    The type of multipatch to be constructed.
    centerPt
    The center point of the Multipatch.
    size
    The size of the shape (height, length, width). It must be greater than 0.
    quality
    A value between 0 and 1 inclusive. A higher quality number means more verticies for the shape resulting in a smoother shape.
    spatialReference
    (Optional)The spatial reference of the Multipatch.

    Return Value

    Exceptions
    ExceptionDescription
    The centerPt is empty or null.
    The size is invalid. It must be greater than 0.
    The quality is invalid. It must be between 0 and 1 inclusive.
    The constructType is invalid for this constructor.
    Example
    Construct 3D special Multipatch shapes
    var sr = MapView.Active.Map.SpatialReference;
    
    var extent = MapView.Active.Extent;
    var center = extent.Center;
    var centerZ = MapPointBuilderEx.CreateMapPoint(center.X, center.Y, 500, sr);
    
    // cube
    multipatch = ArcGIS.Core.Geometry.MultipatchBuilderEx.CreateMultipatch(MultipatchConstructType.Cube, centerZ, 200, sr);
    // tetrahedron
    multipatch = ArcGIS.Core.Geometry.MultipatchBuilderEx.CreateMultipatch(MultipatchConstructType.Tetrahedron, centerZ, 200, sr);
    // diamond
    multipatch = ArcGIS.Core.Geometry.MultipatchBuilderEx.CreateMultipatch(MultipatchConstructType.Diamond, centerZ, 200, sr);
    // hexagon
    multipatch = ArcGIS.Core.Geometry.MultipatchBuilderEx.CreateMultipatch(MultipatchConstructType.Hexagon, centerZ, 200, sr);
    
    // sphere frame
    multipatch = ArcGIS.Core.Geometry.MultipatchBuilderEx.CreateMultipatch(MultipatchConstructType.SphereFrame, centerZ, 200, 0.8, sr);
    // sphere
    multipatch = ArcGIS.Core.Geometry.MultipatchBuilderEx.CreateMultipatch(MultipatchConstructType.Sphere, centerZ, 200, 0.8, sr);
    // cylinder
    multipatch = ArcGIS.Core.Geometry.MultipatchBuilderEx.CreateMultipatch(MultipatchConstructType.Cylinder, centerZ, 200, 0.8, sr);
    // cone
    multipatch = ArcGIS.Core.Geometry.MultipatchBuilderEx.CreateMultipatch(MultipatchConstructType.Cone, centerZ, 200, 0.8, sr);
    
    
    // use the builder to add materials or textures
    //   - create a cone with a material
    builder = new MultipatchBuilderEx(MultipatchConstructType.Cone, centerZ, 200, 0.8, sr);
    
    BasicMaterial faceMaterial = new BasicMaterial();
    faceMaterial.Color = System.Windows.Media.Color.FromRgb(255, 0, 0);
    faceMaterial.Shininess = 150;
    faceMaterial.TransparencyPercent = 50;
    faceMaterial.EdgeWidth = 20;
    
    foreach (var patch in builder.Patches)
      patch.Material = faceMaterial;
    
    multipatch = builder.ToGeometry() as Multipatch;
    Requirements

    Target Platforms: Windows 11, Windows 10

    ArcGIS Pro version: 3 or higher.
    See Also