# `GSNode setAttributes:format:`

*Instance Method*

Replaces all attributes using values encoded for a file format version.

## Declaration

```swift
func setAttributes(_ attributes: [GSShapeKey : Any], format: GSFormatVersion)
```

```objc
- (void) setAttributes:(NSDictionary<NSString *,id> *) attributes format:(GSFormatVersion) format;
```

```python
setAttributes_format_(attributes: dict[str, object], format: GSFormatVersion)
```

## Parameters

- `format` — The file format version used to decode attribute values.

## Discussion

Replacing the attributes with a dictionary registers undo and notifies the path.

## See Also

### Attributes

- [`GSNode.attributes`](/Core/GlyphsCore/GSNode/attributes) — Additional values associated with the node.
- [`GSNode.countOfAttributes`](/Core/GlyphsCore/GSNode/countOfAttributes) — The number of attributes.
- [`GSNode attributeForKey:`](/Core/GlyphsCore/GSNode/attributeForKey:) — The value for an attribute key, or `nil` if no value is set.
- [`GSNode setAttribute:forKey:`](/Core/GlyphsCore/GSNode/setAttribute:forKey:) — Sets or removes an attribute.
- [`GSNode setAttributesFast:format:`](/Core/GlyphsCore/GSNode/setAttributesFast:format:) — Replaces all attributes without registering undo or notifying the path.
- [`GSNode removeAttributeForKey:`](/Core/GlyphsCore/GSNode/removeAttributeForKey:) — Removes an attribute.

