# CollectElements(HashSet<GraphElement>, Func<GraphElement, bool>)

> Retrieves the set of nodes contained in this stack and its edges. The retrieved graph elements match a specific condition.

## Definition

* **Type:** Method
* **Namespace:** [UnityEditor.Experimental.GraphView](/engine/6000.5/script-reference/unityeditor/experimental/graphview.md)
* **Assembly:** UnityEditor

```csharp
public override void CollectElements(HashSet<GraphElement> collectedElementSet, Func<GraphElement, bool> conditionFunc)
```

### Parameters

**** (\[HashSet\<GraphElement>]\(https\://learn.microsoft.com/dotnet/api/system.collections.generic.hashset-1)): The set of matching graph elements.**** (\[Func\<GraphElement, bool>]\(https\://learn.microsoft.com/dotnet/api/system.func-1)): A function that determines whether a graph element is added to the set of matching graph elements.
