---
title: "viewport.sync: Synchronize viewport — CAD kit command — Kition"
description: "Tells the engine the editor viewport's pan offset, zoom and pixel size, so its view matches what is drawn on screen."
canonical: "https://developer.kition.ai/docs/kits/cad/commands/viewport.sync"
---

> Canonical HTML: [https://developer.kition.ai/docs/kits/cad/commands/viewport.sync](https://developer.kition.ai/docs/kits/cad/commands/viewport.sync)

# viewport.sync

**Synchronize viewport.** Tells the engine the editor viewport's pan offset, zoom and pixel size, so its view matches what is drawn on screen.

- Kit: CAD 0.1.0 (.dxf); reference: [CAD kit commands](https://developer.kition.ai/docs/kits/cad.md)
- Changes the document: no

## Parameters

| Name | Type | Required | Description |
| --- | --- | --- | --- |
| `height` | `number` | no |  |
| `width` | `number` | no |  |
| `x` | `number` | no |  |
| `y` | `number` | no |  |
| `zoom` | `number` | no |  |

## Call through cad_run

```text
cad_run {
  "path": "<file>.dxf",
  "steps": [{ "command": "viewport.sync" }]
}
```

The required parameters, with placeholders for their types: not a tested example. Optional: `height`, `width`, `x`, `y`, `zoom`. cad_run answers the step’s result in `completed[i].result`.

## Result



```json
{
  "additionalProperties": true,
  "description": "an empty object",
  "type": "object"
}
```

## Parameter schema

```json
{
  "additionalProperties": false,
  "properties": {
    "height": {
      "type": "number"
    },
    "width": {
      "type": "number"
    },
    "x": {
      "type": "number"
    },
    "y": {
      "type": "number"
    },
    "zoom": {
      "type": "number"
    }
  },
  "type": "object"
}
```

Generated from the command list of @kition/cad-darwin-arm64@0.1.0 and the kit itself (cad_commands through @kition/cli@0.1.1, built from KitionAI/kition-cad@1ec542d).
