ArcGIS Pro 3.2 API Reference Guide
ArcGIS.Core.Geometry Namespace / MultipatchBuilderEx Class / SetPoint Method
The patch index. Must be in the range [0, Patches.Count - 1] inclusive.
The index of the point to modify. Must be in the range [0, Patch.Coords - 1] inclusive.
The MapPoint to set. Point cannot be empty or null.
Example

In This Topic
    SetPoint Method (MultipatchBuilderEx)
    In This Topic
    A convenience method to update the components of a point in the specified Patch.
    Syntax
    public void SetPoint( 
       int patchIndex,
       int pointIndex,
       MapPoint point
    )
    Public Sub SetPoint( _
       ByVal patchIndex As Integer, _
       ByVal pointIndex As Integer, _
       ByVal point As MapPoint _
    ) 

    Parameters

    patchIndex
    The patch index. Must be in the range [0, Patches.Count - 1] inclusive.
    pointIndex
    The index of the point to modify. Must be in the range [0, Patch.Coords - 1] inclusive.
    point
    The MapPoint to set. Point cannot be empty or null.
    Exceptions
    ExceptionDescription
    The pointIndex is less than zero or is greater than or equal to the patch point count.
    The point is null or empty.
    Remarks
    The xy-coordinates of the point are set in the Patch.Coords list. If the point property HasZ is true, then the Z-value of the point is set in the Patch.Coords list. Otherwise, a default Z-value is set in the Patch.Coords list. If the point property HasM is set to true and this builder property HasM is true, then the M-value of the point is set in the Patch.Ms list. Same is true for the Patch.IDs. If the point is missing any of the attributes (Z, M, or ID) that are present in this builder, a default value is used. The default value for Z is zero, M is NaN, and ID is zero. If a point has an attribute that is missing in the builder, the attribute is ignored. If the patch has texture coordinates or normals, then a default value is set. The default value is (0, 0) for texture coordinates and (0, 0, 1) for normals.
    Example
    Construct Multipatch from another Multipatch
    // create the multipatchBuilderEx object
    var builder = new ArcGIS.Core.Geometry.MultipatchBuilderEx(multipatch);
    
    // check some properties
    bool hasM = builder.HasM;
    bool hasZ = builder.HasZ;
    bool hasID = builder.HasID;
    bool isEmpty = builder.IsEmpty;
    bool hasNormals = builder.HasNormals;
    
    var patches = builder.Patches;
    int patchCount = patches.Count;
    
    // if there's some patches
    if (patchCount > 0)
    {
      int pointCount = builder.GetPatchPointCount(0);
    
      // replace the first point in the first patch
      if (pointCount > 0)
      {
        // get the first point
        var pt = builder.GetPoint(0, 0);
        builder.SetPoint(0, 0, newPoint);
      }
    
      // check which patches currently contain the texture
      var texture = builder.QueryPatchIndicesWithTexture(brickTextureResource);
    
      // assign a texture material
      patches[0].Material = brickMaterialTexture;
    }
    
    // update the builder for M awareness
    builder.HasM = true;
    // synchronize the patch attributes to match the builder attributes
    //   in this instance because we just set HasM to true on the builder, each patch will now get a default M value for it's set of coordinates
    builder.SynchronizeAttributeAwareness();
    
    // call ToGeometry to get the multipatch
    multipatch = builder.ToGeometry() as Multipatch;
    
    // multipatch.HasM will be true
    
    Requirements

    Target Platforms: Windows 11, Windows 10

    ArcGIS Pro version: 3 or higher.
    See Also