# `GSLayer selectedPaths:notSelected:`

*Instance Method*

Separates paths by whether they contain selected nodes.

## Declaration

```swift
func selectedPaths(_ selectedPaths: NSMutableArray, notSelected notSelectedPaths: NSMutableArray?)
```

```objc
- (void) selectedPaths:(NSMutableArray *) selectedPaths notSelected:(NSMutableArray *) notSelectedPaths;
```

```python
selectedPaths_notSelected_(selectedPaths: list, notSelectedPaths: list)
```

## Parameters

- `selectedPaths` — The array to which paths containing selected nodes are added.
- `notSelectedPaths` — The array to which the remaining paths are added.

## Discussion

When no path contains a selected node, the last path is treated as selected.

## See Also

### Selection Serialization

- [`GSLayer selectedObjects`](/Core/GlyphsCore/GSLayer/selectedObjects) — Content representing the selected elements for serialization and paste.
- [`GSLayer selectedElementsMappings`](/Core/GlyphsCore/GSLayer/selectedElementsMappings) — Structural mappings for the selected elements.
- [`GSLayer removeMappedElements:`](/Core/GlyphsCore/GSLayer/removeMappedElements:) — Removes elements described by structural mappings.
- [`GSLayer removeElement:`](/Core/GlyphsCore/GSLayer/removeElement:) — Removes a selectable element from the layer.
- [`GSLayer removeNodesCutPath:`](/Core/GlyphsCore/GSLayer/removeNodesCutPath:) — Removes mapped nodes while preserving the unselected path portions.
- [`GSLayer pasteDict:format:selectedNodes:error:`](/Core/GlyphsCore/GSLayer/pasteDict:format:selectedNodes:error:) — Adds content from a serialized selection dictionary.

