# `GSGlyph replaceObjectInAxesAtIndex:withObject:`

*Instance Method*

Replaces the glyph-local axis at an index.

## Declaration

```swift
func replaceAxis(at idx: UInt, with axis: GSAxis)
```

```objc
- (void) replaceObjectInAxesAtIndex:(NSUInteger) idx withObject:(GSAxis *) axis;
```

```python
replaceObjectInAxesAtIndex_withObject_(idx: int, axis: GSAxis)
```

## Parameters

- `idx` — A valid index in [`GSGlyph.axes`](/Core/GlyphsCore/GSGlyph/axes).
- `axis` — The replacement axis.

## Discussion

The replacement axis becomes owned by the glyph, and the replaced axis no longer belongs to the glyph.

## See Also

### Glyph Axes

- [`GSGlyph.axes`](/Core/GlyphsCore/GSGlyph/axes) — The glyph-local axes used by Smart Components.
- [`GSGlyph.countOfAxes`](/Core/GlyphsCore/GSGlyph/countOfAxes) — The number of glyph-local axes.
- [`GSGlyph objectInAxesAtIndex:`](/Core/GlyphsCore/GSGlyph/objectInAxesAtIndex:) — The glyph-local axis at an index, or `nil` when the index is out of range.
- [`GSGlyph insertObject:inAxesAtIndex:`](/Core/GlyphsCore/GSGlyph/insertObject:inAxesAtIndex:) — Inserts a glyph-local axis at an index.
- [`GSGlyph removeObjectFromAxesAtIndex:`](/Core/GlyphsCore/GSGlyph/removeObjectFromAxesAtIndex:) — Removes the glyph-local axis at an index.
- [`GSGlyph.allAxes`](/Core/GlyphsCore/GSGlyph/allAxes) — The axes defining a complete design-space location for the glyph.
- [`GSGlyph countOfAllAxes`](/Core/GlyphsCore/GSGlyph/countOfAllAxes) — The total number of font axes and glyph-local axes.
- [`GSGlyph axesRanges:internMax:axes:masterId:`](/Core/GlyphsCore/GSGlyph/axesRanges:internMax:axes:masterId:) — Computes the internal coordinate range of each selected axis.

