Operaciones de BadBit CAD
cad.view.pan
Desplaza la vista (ENCUADRE).
- Programa: BadBit CAD
- Tipo de acción: Lee el dibujo
- Solo lectura
- Desde la versión 2027.0.0-beta.8
Desplaza la vista por delta [dx, dy] del dibujo en pantalla, o de from a to, como ENCUADRE por dos puntos. El dibujo no cambia. Devuelve el área visible.
Parámetros
| Nombre | Tipo | Obligatorio | Descripción |
|---|---|---|---|
delta | array<number> | null | No | La longitud a añadir (negativa acorta); en ENCUADRE, el desplazamiento [dx, dy] del dibujo en pantalla. |
from | array<number> | null | No | El punto base [x, y] (el desplazamiento empieza aquí). |
to | array<number> | null | No | El segundo punto [x, y] (el desplazamiento es to menos from). |
Errores
| Código | JSON-RPC | Qué significa |
|---|---|---|
invalid_params | -32602 | Los parámetros no siguen el esquema o una regla de la operación. |
not_found | -32001 | El objeto, la operación, el archivo o el nombre no existe. |
conflict | -32004 | El estado actual no lo permite ahora. |
failed | -32005 | La operación falló. |
Ejemplo
MCP
JSON
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"arguments": {
"delta": [
100,
0
]
},
"operation": "cad.view.pan"
},
"name": "badbit_call_operation"
}
}Python
Python
import badbit
result = badbit.cad.view.pan(delta=[100, 0])LISP
LISP
(badbit-call "cad.view.pan" '(("delta" . (100 0))))JSON-RPC
JSON
{
"id": 1,
"jsonrpc": "2.0",
"method": "badbit/call",
"params": {
"arguments": {
"delta": [
100,
0
]
},
"operation": "cad.view.pan"
}
}Comandos que hacen lo mismo
Esquema completo
JSON Schema 2020-12, con las descripciones en inglés.
Parámetros (entrada)
JSON
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"additionalProperties": false,
"properties": {
"delta": {
"default": null,
"description": "Length to add (negative shortens); in PAN, the displacement [dx, dy] of the drawing on screen.",
"items": {
"format": "double",
"type": "number"
},
"maxItems": 2,
"minItems": 2,
"type": [
"array",
"null"
]
},
"from": {
"default": null,
"description": "The base point [x, y] (the displacement starts here).",
"items": {
"format": "double",
"type": "number"
},
"maxItems": 2,
"minItems": 2,
"type": [
"array",
"null"
]
},
"to": {
"default": null,
"description": "The second point [x, y] (the displacement is to minus from).",
"items": {
"format": "double",
"type": "number"
},
"maxItems": 2,
"minItems": 2,
"type": [
"array",
"null"
]
}
},
"type": "object"
}Resultado (salida)
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"
}