ArcGIS Pro 3.8 API Reference Guide
ArcGIS.Desktop.Mapping Namespace / FeatureSceneLayer Class / Search Method
A query filter or spatial filter
Example

In This Topic
    Search Method (FeatureSceneLayer)
    In This Topic
    Search for features based upon the specified attribute and/or spatial criteria. This method must be called on the MCT. Use QueuedTask.Run.
    Syntax
    public RowCursor Search( 
       QueryFilter queryFilter
    )
    Public Function Search( _
       Optional ByVal queryFilter As QueryFilter _
    ) As RowCursor

    Parameters

    queryFilter
    A query filter or spatial filter

    Return Value

    Exceptions
    ExceptionDescription
    This method or property must be called within the lambda passed to QueuedTask.Run.
    No associated feature service
    A geodatabase-related exception has occurred.
    Remarks
    Search can only be used on feature scene layers that have an associated feature service. Check HasAssociatedFeatureService property to determine if the FeatureSceneLayer has an associated feature service. Calling Search() on a FeatureSceneLayer with no associated feature service will throw a System.InvalidOperationException
    Example
    Search Rows on the FeatureSceneLayer
    {
      if (!featSceneLayer.HasAssociatedFeatureService)
      {
        return;//Search and Select not supported
      }
    
      //Multipatch (Object3D) or point?
      //var is3dObject = ((ISceneLayerInfo)featSceneLayer).SceneServiceLayerType
      //                                  == esriSceneServiceLayerType.Object3D;
      var is3dObject = featSceneLayer.FeatureSceneLayerType == FeatureSceneLayerType.Object3D;
      await QueuedTask.Run(() =>
      {
        var queryFilter = new QueryFilter
        {
          WhereClause = "Name = 'Ponderosa Pine'",
          SubFields = "*"
        };
    
        int rowCount = 0;
        //or select... var select = featSceneLayer.Select(queryFilter)
        using (RowCursor rowCursor = featSceneLayer.Search(queryFilter))
        {
          while (rowCursor.MoveNext())
          {
            using (var feature = rowCursor.Current as Feature)
            {
              oid = feature.GetObjectID();
              var shape = feature.GetShape();
              var attrib = feature["Name"];
              if (is3dObject)
              {
                //shape is a multipatch
              }
              else
              {
                //shape is a point
              }
              rowCount += 1;
            }
          }
        }
      });
    }
    Requirements

    Target Platforms: Windows 11 Home, Pro, Enterprise (64 bit)

    ArcGIS Pro version: 3.0 or higher.
    See Also