ArcGIS Pro 2.7 API Reference Guide
QueryPatchIndicesWithTexture Method
Example 

ArcGIS.Core.Geometry Namespace > MultipatchBuilderEx Class : QueryPatchIndicesWithTexture Method
TextureResource instance to check. If null, the method will collect indices of all patches that have null texture resource.
Returns an array of patch indices that reference the given TextureResource instance.
Syntax
public int[] QueryPatchIndicesWithTexture( 
   TextureResource textureResource
)
Public Function QueryPatchIndicesWithTexture( _
   ByVal textureResource As TextureResource _
) As Integer()

Parameters

textureResource
TextureResource instance to check. If null, the method will collect indices of all patches that have null texture resource.

Return Value

Returns an array of patch indices. The array is empty if no patches reference the given texture resource instance.
Example
// 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 10, Windows 8.1

See Also

Reference

MultipatchBuilderEx Class
MultipatchBuilderEx Members