# `GSShape drawInPen:`

*Instance Method*

Writes the shape to a pen.

## Declaration

```swift
func draw(inPen pen: any GSPenProtocol & NSObjectProtocol)
```

```objc
- (void) drawInPen:(NSObject<GSPenProtocol> *) pen;
```

```python
drawInPen_(pen: NSObject<GSPenProtocol>)
```

## Discussion

Closed and open paths are written to the same pen. No auxiliary output is produced.

## See Also

### Drawing

- [`GSShape drawInPen:openPen:secondaryPen:extraHandles:`](/Core/GlyphsCore/GSShape/drawInPen:openPen:secondaryPen:extraHandles:) — Writes the shape to separate pens for closed paths, open paths, and auxiliary output.
- [`GSShape drawSimpleInPen:`](/Core/GlyphsCore/GSShape/drawSimpleInPen:) — Writes the basic shape representation to a pen without resolving path decorations.
- [`GSShape drawSimpleInPen:fast:`](/Core/GlyphsCore/GSShape/drawSimpleInPen:fast:) — Writes the basic shape representation to a pen, optionally omitting segment object information.

