Operações da suíte
suite.view.zoom
Muda o que a vista mostra: extensão, uma janela, um centro, a vista anterior ou um fator.
- Programa: Todos os programas
- Tipo de ação: Lê o desenho
- Só leitura
- Desde a versão 2027.0.0-beta.6
Move a vista do desenho ativo e devolve a área visível depois da mudança, como [xmin, ymin, xmax, ymax] em unidades do desenho. Não muda o desenho.
Parâmetros
| Nome | Tipo | Obrigatório | Descrição |
|---|---|---|---|
center | array<number> | null | Não | Ponto do centro [x, y]. |
factor | number | null | Não | Fator do zoom (2 aproxima duas vezes; 0.5 afasta). |
height | number | null | Não | A altura do texto; no zoom, a altura visível; nas imagens, a altura em pixels; na vista nomeada, em unidades do desenho; na janela de vista, a altura do modelo que ela mostra, em unidades do desenho. |
mode | ZoomMode | Sim | O modo: no zoom, extents, window, center, previous ou factor; na medida, distance, radius, angle ou area; no isolamento, isolate, hide ou end. |
window | array<number> | null | Não | Janela [xmin, ymin, xmax, ymax] em unidades do desenho (no papel de um layout, em mm). |
Erros
| Código | JSON-RPC | O que significa |
|---|---|---|
invalid_params | -32602 | Os parâmetros não seguem o esquema ou uma regra da operação. |
Exemplo
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"
}
}Comandos que fazem o mesmo
Esquema completo
JSON Schema 2020-12, com as descrições em inglês.
Parâmetros (entrada)
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"
}Resultado (saída)
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"
}