ArcGIS Pro 3.2 API Reference Guide
ArcGIS.Core.Geometry Namespace / MultipatchBuilderEx Class / SynchronizeAttributeAwareness Method
Example

In This Topic
    SynchronizeAttributeAwareness Method
    In This Topic
    Synchronizes attribute awareness of Patches to match attribute awareness of the MultipatchBuilderEx.
    Syntax
    public bool SynchronizeAttributeAwareness()
    Public Function SynchronizeAttributeAwareness() As Boolean

    Return Value

    Returns true if the patches have been changed and false otherwise.
    Remarks
    Attribute awareness refers to whether the patch recognizes M-values or ID-values or not. Applies attribute awareness of MultipatchBuilderEx to all the Patches contained in the builder. Synchronizes sizes of attribute lists of individual patches to match the size of the Patch.Coords list.
    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