# setRotation

#### setRotation

Sets the rotation of an object.

#### Signature

```typescript
setRotation(objectName: string, rotation: Euler): Promise<void>
```

#### Parameters

<table><thead><tr><th width="166.328125">Name</th><th width="136.90625">Type</th><th width="115.171875">Required</th><th>Description</th></tr></thead><tbody><tr><td><code>objectName</code></td><td><code>string</code></td><td>Yes</td><td>Object name</td></tr><tr><td><code>rotation</code></td><td><a href="/pages/RZyW5ho4Rsef15nPuwB4#euler">Euler</a></td><td>Yes</td><td>New rotation <code>{x, y, z}</code> in degrees. Optional <code>order</code> field.</td></tr></tbody></table>

#### Returns

`Promise<void>`

#### Usage

```javascript
// Rotate 45 degrees around Y axis
await api.setRotation("Chair", { x: 0, y: 45, z: 0 });

// With explicit rotation order
await api.setRotation("Chair", { x: 90, y: 0, z: 0, order: "XYZ" });
```

#### Notes

* Values are in **degrees**, not radians
* Sets **local** rotation (relative to parent)
* **Important:** Always provide all three coordinates (x, y, z). Missing values become `null`, not preserved
* The `order` field is optional (defaults to "XYZ")
* Only accepts string name, not array


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://help.vectary.com/api/model-api/api-reference/setrotation.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
