Skip to content
BadBit Documentation
Sign in Download the beta

BadBit CAD operations

cad.format.scale_list

Adds and removes scales in the list (SCALELISTEDIT).

  • Program: BadBit CAD
  • Type of action: Changes the drawing
  • Deletes
  • Since version 2027.0.0-beta.8

Changes the scale list of the drawing, like SCALELISTEDIT: reset goes back to the default list, delete removes scales by name, add puts new ones (name, paper, drawing). Returns the new list.

Parameters

NameTypeRequiredDescription
addarray<ScaleItem>NoThe items to add.
deletearray<string>NoThe names to remove (in the reply, the ones removed).
resetbooleanNoGoes back to the default list before the rest.

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": {
        "add": [
          {
            "drawing": 33,
            "name": "1:33",
            "paper": 1
          }
        ]
      },
      "operation": "cad.format.scale_list"
    },
    "name": "badbit_call_operation"
  }
}

Python

Python
import badbit

result = badbit.cad.format.scale_list(add=[{"drawing": 33, "name": "1:33", "paper": 1}])

LISP

LISP
(badbit-call "cad.format.scale_list" '(("add" . ((("drawing" . 33) ("name" . "1:33") ("paper" . 1))))))

JSON-RPC

JSON
{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "badbit/call",
  "params": {
    "arguments": {
      "add": [
        {
          "drawing": 33,
          "name": "1:33",
          "paper": 1
        }
      ]
    },
    "operation": "cad.format.scale_list"
  }
}

Commands that do the same

-SCALELISTEDITSCALELISTEDIT

Full schema

JSON Schema 2020-12.

Parameters (input)
JSON
{
  "$defs": {
    "ScaleItem": {
      "additionalProperties": false,
      "properties": {
        "drawing": {
          "description": "The drawing units.",
          "format": "double",
          "type": "number"
        },
        "name": {
          "description": "Name (of the layer, of the system variable or of the command, depending on the operation).",
          "maxLength": 255,
          "minLength": 1,
          "type": "string"
        },
        "paper": {
          "description": "The paper: its name or the paper units, depending on the operation.",
          "format": "double",
          "type": "number"
        }
      },
      "required": [
        "name",
        "paper",
        "drawing"
      ],
      "type": "object"
    }
  },
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "additionalProperties": false,
  "properties": {
    "add": {
      "default": [],
      "description": "The items to add.",
      "items": {
        "$ref": "#/$defs/ScaleItem"
      },
      "maxItems": 1000,
      "type": "array"
    },
    "delete": {
      "default": [],
      "description": "The names to remove (in the reply, the ones removed).",
      "items": {
        "type": "string"
      },
      "maxItems": 1000,
      "type": "array"
    },
    "reset": {
      "default": false,
      "description": "Goes back to the default list before the rest.",
      "type": "boolean"
    }
  },
  "type": "object"
}
Result (output)
JSON
{
  "$defs": {
    "ScaleItem": {
      "additionalProperties": false,
      "properties": {
        "drawing": {
          "description": "The drawing units.",
          "format": "double",
          "type": "number"
        },
        "name": {
          "description": "Name (of the layer, of the system variable or of the command, depending on the operation).",
          "maxLength": 255,
          "minLength": 1,
          "type": "string"
        },
        "paper": {
          "description": "The paper: its name or the paper units, depending on the operation.",
          "format": "double",
          "type": "number"
        }
      },
      "required": [
        "name",
        "paper",
        "drawing"
      ],
      "type": "object"
    }
  },
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "properties": {
    "scales": {
      "description": "The scales, each with name, paper and drawing.",
      "items": {
        "$ref": "#/$defs/ScaleItem"
      },
      "type": "array"
    }
  },
  "required": [
    "scales"
  ],
  "type": "object"
}
Search the documentation