# `GSBaseObject setPosition:forLayerWidth:`

*Instance Method*

Sets the position in layer coordinates for a layer width.

## Declaration

```swift
func setPosition(_ position: NSPoint, forLayerWidth width: CGFloat)
```

```objc
- (void) setPosition:(NSPoint) position forLayerWidth:(CGFloat) width;
```

```python
setPosition_forLayerWidth_(position: NSPoint, width: float)
```

## Parameters

- `width` — The layer width used for orientation adjustment.

## Discussion

When the element belongs to a layer, setting the position registers undo, aligns it to the layer grid, and notifies its parent.

## See Also

### Position

- [`GSBaseObject.position`](/Core/GlyphsCore/GSBaseObject/position) — The position in layer coordinates.
- [`GSBaseObject positionForLayerWidth:`](/Core/GlyphsCore/GSBaseObject/positionForLayerWidth:) — The position in layer coordinates for a layer width.
- [`GSBaseObject positionFast`](/Core/GlyphsCore/GSBaseObject/positionFast) — The position without orientation adjustment.
- [`GSBaseObject setPositionFast:`](/Core/GlyphsCore/GSBaseObject/setPositionFast:) — Sets the position without registering undo or notifying the parent.
- [`GSBaseObject setPositionFast:grid:`](/Core/GlyphsCore/GSBaseObject/setPositionFast:grid:) — Sets the unrounded position and rounds the position to a grid without registering undo or notifying the parent.
- [`GSBaseObject.positionPrecise`](/Core/GlyphsCore/GSBaseObject/positionPrecise) — The unrounded position in layer coordinates.
- [`GSBaseObject positionPreciseForLayerWidth:`](/Core/GlyphsCore/GSBaseObject/positionPreciseForLayerWidth:) — The unrounded position in layer coordinates for a layer width.
- [`GSBaseObject positionPreciseFast`](/Core/GlyphsCore/GSBaseObject/positionPreciseFast) — The unrounded position without orientation adjustment.
- [`GSBaseObject roundToGrid:`](/Core/GlyphsCore/GSBaseObject/roundToGrid:) — Rounds the position to a grid.
- [`GSBaseObject roundToGridFast:`](/Core/GlyphsCore/GSBaseObject/roundToGridFast:) — Rounds the position to a grid without registering undo or notifying the parent.
- [`GSBaseObject.orientation`](/Core/GlyphsCore/GSBaseObject/orientation) — The orientation of the element position.

