Suite operations
suite.view.zoom
Changes what the view shows: extents, a window, a center, the previous view or a factor.
- Program: All programs
- Type of action: Reads the drawing
- Read only
- Since version 2027.0.0-beta.6
Moves the view of the active drawing and returns the visible area after the change, as [xmin, ymin, xmax, ymax] in drawing units. Does not change the drawing.
Parameters
| Name | Type | Required | Description |
|---|---|---|---|
center | array<number> | null | No | Center point [x, y]. |
factor | number | null | No | Zoom factor (2 zooms in twice; 0.5 zooms out). |
height | number | null | No | Text height; in zoom, the visible height; in images, the height in pixels; in a named view, in drawing units; in a layout viewport, the height of the model it shows, in drawing units. |
mode | ZoomMode | Yes | The mode: in zoom, extents, window, center, previous or factor; in a measurement, distance, radius, angle or area; in isolation, isolate, hide or end. |
window | array<number> | null | No | Window [xmin, ymin, xmax, ymax] in drawing units (in the paper space of a layout, in mm). |
Errors
| Code | JSON-RPC | Meaning |
|---|---|---|
invalid_params | -32602 | The parameters do not follow the schema or a rule of the operation. |
Example
MCP
JSON
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"arguments": {
"mode": "extents"
},
"operation": "suite.view.zoom"
},
"name": "badbit_call_operation"
}
}Python
Python
import badbit
result = badbit.suite.view.zoom(mode="extents")LISP
LISP
(badbit-call "suite.view.zoom" '(("mode" . "extents")))JSON-RPC
JSON
{
"id": 1,
"jsonrpc": "2.0",
"method": "badbit/call",
"params": {
"arguments": {
"mode": "extents"
},
"operation": "suite.view.zoom"
}
}Commands that do the same
Full schema
JSON Schema 2020-12.
Parameters (input)
JSON
{
"$defs": {
"ZoomMode": {
"oneOf": [
{
"const": "extents",
"type": "string"
},
{
"const": "window",
"type": "string"
},
{
"const": "center",
"type": "string"
},
{
"const": "previous",
"type": "string"
},
{
"const": "factor",
"type": "string"
}
]
}
},
"$schema": "https://json-schema.org/draft/2020-12/schema",
"additionalProperties": false,
"properties": {
"center": {
"default": null,
"description": "Center point [x, y].",
"items": {
"format": "double",
"type": "number"
},
"maxItems": 2,
"minItems": 2,
"type": [
"array",
"null"
]
},
"factor": {
"default": null,
"description": "Zoom factor (2 zooms in twice; 0.5 zooms out).",
"format": "double",
"minimum": 0,
"type": [
"number",
"null"
]
},
"height": {
"default": null,
"description": "Text height; in zoom, the visible height; in images, the height in pixels; in a named view, in drawing units; in a layout viewport, the height of the model it shows, in drawing units.",
"format": "double",
"minimum": 0,
"type": [
"number",
"null"
]
},
"mode": {
"$ref": "#/$defs/ZoomMode",
"description": "The mode: in zoom, extents, window, center, previous or factor; in a measurement, distance, radius, angle or area; in isolation, isolate, hide or end."
},
"window": {
"default": null,
"description": "Window [xmin, ymin, xmax, ymax] in drawing units (in the paper space of a layout, in mm).",
"items": {
"format": "double",
"type": "number"
},
"maxItems": 4,
"minItems": 4,
"type": [
"array",
"null"
]
}
},
"required": [
"mode"
],
"type": "object"
}Result (output)
JSON
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"properties": {
"visible": {
"description": "The visible area after the view changes [xmin, ymin, xmax, ymax].",
"items": {
"format": "double",
"type": "number"
},
"maxItems": 4,
"minItems": 4,
"type": "array"
}
},
"required": [
"visible"
],
"type": "object"
}