Skip to content
BadBit Documentation
Sign in Download the beta

BadBit CAD operations

cad.view.pan

Moves the view (PAN).

  • Program: BadBit CAD
  • Type of action: Reads the drawing
  • Read only
  • Since version 2027.0.0-beta.8

Moves the view by delta [dx, dy] of the drawing on screen, or from from to to, like PAN by two points. The drawing does not change. Returns the visible area.

Parameters

NameTypeRequiredDescription
deltaarray<number> | nullNoLength to add (negative shortens); in PAN, the displacement [dx, dy] of the drawing on screen.
fromarray<number> | nullNoThe base point [x, y] (the displacement starts here).
toarray<number> | nullNoThe second point [x, y] (the displacement is to minus from).

Errors

CodeJSON-RPCMeaning
invalid_params-32602The parameters do not follow the schema or a rule of the operation.
not_found-32001The object, operation, file or name does not exist.
conflict-32004The current state does not allow this now.
failed-32005The operation failed.

Example

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"
  }
}

Commands that do the same

PAN

Full schema

JSON Schema 2020-12.

Parameters (input)
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"
}
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"
}
Search the documentation