# `GSLayer nodeAtPoint:excludeNodes:traverseComponents:ignoreLocked:tolerance:`

*Instance Method*

Returns the nearest node to a point, excluding a set of objects.

## Declaration

```swift
func node(at aPoint: NSPoint, excludeNodes excludes: Set<GSNode>?, traverseComponents: Bool, ignoreLocked: Bool, tolerance: CGFloat) -> GSNode?
```

```objc
- (GSNode *) nodeAtPoint:(NSPoint) aPoint excludeNodes:(NSSet<GSNode *> *) excludes traverseComponents:(BOOL) traverseComponents ignoreLocked:(BOOL) ignoreLocked tolerance:(CGFloat) tolerance;
```

```python
nodeAtPoint_excludeNodes_traverseComponents_ignoreLocked_tolerance_(aPoint: NSPoint, excludes: set[GSNode], traverseComponents: bool, ignoreLocked: bool, tolerance: float) -> GSNode
```

## Parameters

- `excludes` — Nodes or components to exclude from the search.
- `traverseComponents` — When `YES`, the search uses node positions from component outlines and returns a transient node.

## Return Value

The nearest node within `tolerance`, or `nil` if no node matches.

## Discussion

Locked paths and nodes are skipped when `ignoreLocked` is `YES`.

## See Also

### Node Hit Testing

- [`GSLayer nodeAtPoint:excludeNode:ignoreLocked:tolerance:`](/Core/GlyphsCore/GSLayer/nodeAtPoint:excludeNode:ignoreLocked:tolerance:) — Returns the nearest node to a point, excluding one node.
- [`GSLayer indexPathOfNodeAtX:actualPosition:`](/Core/GlyphsCore/GSLayer/indexPathOfNodeAtX:actualPosition:) — Returns the index path of an on-curve node near the given x position.
- [`GSLayer indexPathOfNodeAtY:actualPosition:`](/Core/GlyphsCore/GSLayer/indexPathOfNodeAtY:actualPosition:) — Returns the index path of an on-curve node near the given y position.

