# `GSLayer removeMappedElements:`

*Instance Method*

Removes elements described by structural mappings.

## Declaration

```swift
func removeMappedElements(_ selectedElementsMappings: [AnyHashable : Any])
```

```objc
- (void) removeMappedElements:(NSDictionary *) selectedElementsMappings;
```

```python
removeMappedElements_(selectedElementsMappings: dict)
```

## Parameters

- `selectedElementsMappings` — Mappings produced by [`GSLayer selectedElementsMappings`](/Core/GlyphsCore/GSLayer/selectedElementsMappings).

## Discussion

The mappings must refer to corresponding content in the receiver.

> **Important**
> Mappings go out of sync if the layer contents were edited since creating the mapping. Use this method only when no such mutations took place.

## 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 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.
- [`GSLayer selectedPaths:notSelected:`](/Core/GlyphsCore/GSLayer/selectedPaths:notSelected:) — Separates paths by whether they contain selected nodes.

