CAD kit command

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)
Changes the document
no

Parameters

Parameters of viewport.sync
NameTypeRequiredDescription
heightnumberno
widthnumberno
xnumberno
ynumberno
zoomnumberno

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

Result JSON Schema
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/[email protected] and the kit itself (cad_commands through @kition/[email protected], built from KitionAI/kition-cad@1ec542d). As data: commands.jsonl.