# `GSLayer setCurrentDrawingAttribute:forKey:`

*Instance Method*

Sets or removes an attribute applied to newly drawn shapes.

## Declaration

```swift
func setCurrentDrawingAttribute(_ attr: Any?, forKey key: String)
```

```objc
- (void) setCurrentDrawingAttribute:(id) attr forKey:(NSString *) key;
```

```python
setCurrentDrawingAttribute_forKey_(attr: object, key: str)
```

## Parameters

- `attr` — The attribute value, or `nil` to remove the attribute.
- `key` — The shape attribute key.

## See Also

### Drawing State

- [`GSLayer.secondaryPath`](/Core/GlyphsCore/GSLayer/secondaryPath) — Auxiliary outlines generated by the most recent full Bézier path preparation.
- [`GSLayer.extraHandles`](/Core/GlyphsCore/GSLayer/extraHandles) — Interactive handles generated by the most recent full Bézier path preparation.
- [`GSLayer.currentDrawingAttributes`](/Core/GlyphsCore/GSLayer/currentDrawingAttributes) — The shape attributes applied to newly drawn shapes.
- [`GSLayer addCurrentDrawingAttributes:`](/Core/GlyphsCore/GSLayer/addCurrentDrawingAttributes:) — Adds shape attributes applied to newly drawn shapes.
- [`GSLayer prepareDrawing`](/Core/GlyphsCore/GSLayer/prepareDrawing) — Prepares path component hints for direct pen drawing.
- [`GSLayer finishDrawing`](/Core/GlyphsCore/GSLayer/finishDrawing) — Finishes direct pen drawing prepared by [`GSLayer prepareDrawing`](/Core/GlyphsCore/GSLayer/prepareDrawing).

