    

 ## On this page

  

 

 # ansys::Project::Query Class Reference

 Last update: 16.07.2025 

Set of conditions used in search within the [Project](classansys_1_1_project_1_1_project.xhtml "Base class for Project API, also see SimProject."). See [Iterator::find()](classansys_1_1_project_1_1_iterator.xhtml#a117905095e2e70e0a2f9dbe051882bec "Execute a Query onto the current Iterator.") [More...](classansys_1_1_project_1_1_query.xhtml#details)

`#include "<a class="el" href="_query_8hpp_source.xhtml">Query.hpp</a>"`

## <a id="pub-methods" name="pub-methods"></a>Public Member Functions

<a id="accc4b3a49109a0d992c9bea5f67de8b2" name="accc4b3a49109a0d992c9bea5f67de8b2"></a> **Query** (std::string pKey, Operator pOp) Constructor, simple query with unary operator.   
 <a id="aa11759b898e8ce9ad56ea93b5e7f3fe9" name="aa11759b898e8ce9ad56ea93b5e7f3fe9"></a> **Query** (std::string pKey, Operator pOp, std::string pVal) Constructor, simple query with binary operator.   
 <a id="a94479fcb90a6a98679740625ceeef0a9" name="a94479fcb90a6a98679740625ceeef0a9"></a>[Query](classansys_1_1_project_1_1_query.xhtml) &amp; **operator+=** (const [Query](classansys_1_1_project_1_1_query.xhtml) &amp;pObj) Append a [Query](classansys_1_1_project_1_1_query.xhtml "Set of conditions used in search within the Project. See Iterator::find()") object to the current.   
 bool [evaluate](classansys_1_1_project_1_1_query.xhtml#a2954de4bce6cb1e254c5fc05071d05aa) (const [Iterator](classansys_1_1_project_1_1_iterator.xhtml) &amp;pIter) Evaluates the query for the specified iterator. [More...](classansys_1_1_project_1_1_query.xhtml#a2954de4bce6cb1e254c5fc05071d05aa)  
 bool [evaluate](classansys_1_1_project_1_1_query.xhtml#adb860209358e8dffe5703593f991637f) (const [Metadata](classansys_1_1_project_1_1_metadata.xhtml) &amp;pMeta) Evaluates the query for the specified metadata object Only variable names prefixed by [Metadata](classansys_1_1_project_1_1_metadata.xhtml "Dictionary of values associated with an Iterator."):: will be evaluated. [More...](classansys_1_1_project_1_1_query.xhtml#adb860209358e8dffe5703593f991637f)  
 <a id="details" name="details"></a>## Detailed Description

Set of conditions used in search within the [Project](classansys_1_1_project_1_1_project.xhtml "Base class for Project API, also see SimProject."). See [Iterator::find()](classansys_1_1_project_1_1_iterator.xhtml#a117905095e2e70e0a2f9dbe051882bec "Execute a Query onto the current Iterator.")

[Query](classansys_1_1_project_1_1_query.xhtml "Set of conditions used in search within the Project. See Iterator::find()") variables:

- name : The project item name
- type : The project item type (File, Folder, Link, ...)
- subclass : The item subclass
- [Metadata](classansys_1_1_project_1_1_metadata.xhtml "Dictionary of values associated with an Iterator.")::\* : The metadata key named \*

[Query](classansys_1_1_project_1_1_query.xhtml "Set of conditions used in search within the Project. See Iterator::find()") operators:

- OpEqual , OpNotEqual : Equality operator
- OpContains : Check if the string contains the specified value
- OpListContains : Check if the data is a CSV vector and contains the value
- OpHasKey : Check if the key is known ([Metadata](classansys_1_1_project_1_1_metadata.xhtml "Dictionary of values associated with an Iterator.")::\*)

A query will succeed if all key-operator-\[value\] tuples are true.



## Member Function Documentation

<a id="a2954de4bce6cb1e254c5fc05071d05aa" name="a2954de4bce6cb1e254c5fc05071d05aa"></a>## [◆ ](#a2954de4bce6cb1e254c5fc05071d05aa)evaluate() \[1/2\]

 bool ansys::Project::Query::evaluate  ( const [Iterator](classansys_1_1_project_1_1_iterator.xhtml) &amp;  *pIter*) 

Evaluates the query for the specified iterator.

Returnstrue if the [Query](classansys_1_1_project_1_1_query.xhtml "Set of conditions used in search within the Project. See Iterator::find()") matches the iterator content. 



<a id="adb860209358e8dffe5703593f991637f" name="adb860209358e8dffe5703593f991637f"></a>## [◆ ](#adb860209358e8dffe5703593f991637f)evaluate() \[2/2\]

 bool ansys::Project::Query::evaluate  ( const [Metadata](classansys_1_1_project_1_1_metadata.xhtml) &amp;  *pMeta*) 

Evaluates the query for the specified metadata object Only variable names prefixed by [Metadata](classansys_1_1_project_1_1_metadata.xhtml "Dictionary of values associated with an Iterator."):: will be evaluated.

Returnstrue if the [Metadata](classansys_1_1_project_1_1_metadata.xhtml "Dictionary of values associated with an Iterator.") matches the iterator content.