Saltar al contenido
BadBit Documentación
Iniciar sesión Descargar la beta

Operaciones de BadBit CAD

cad.format.table_style

Crea o cambia un estilo de tabla (TABLESTYLE).

  • Programa: BadBit CAD
  • Tipo de acción: Cambia el dibujo
  • Modifica el dibujo
  • Desde la versión 2027.0.0-beta.8

Crea el estilo de tabla name (a partir del actual) o cambia el que existe, como la ventana de TABLESTYLE: direction (down o up), text_style de las celdas y las alturas del texto del título (title_height), del encabezado (header_height) y de los datos (data_height). Las tablas que usan el estilo se redibujan. set_current lo vuelve el actual. Devuelve si se creó y cuántas tablas cambiaron.

Parámetros

NombreTipoObligatorioDescripción
data_heightnumber | nullNoLa altura del texto de los datos.
directionDirection | nullNoHacia dónde crecen las filas de la tabla: down o up.
header_heightnumber | nullNoLa altura del texto del encabezado.
namestringSíNombre (de la capa, de la variable de sistema o del comando, según la operación).
set_currentbooleanNoVuelve el estilo el actual.
text_stylestring | nullNoEl estilo de texto.
title_heightnumber | nullNoLa altura del texto del título.

Errores

CódigoJSON-RPCQué significa
invalid_params-32602Los parámetros no siguen el esquema o una regla de la operación.
not_found-32001El objeto, la operación, el archivo o el nombre no existe.
conflict-32004El estado actual no lo permite ahora.
failed-32005La operación falló.

Ejemplo

MCP

JSON
{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {
      "arguments": {
        "data_height": 2.5,
        "header_height": 3,
        "name": "Quadro",
        "title_height": 4
      },
      "operation": "cad.format.table_style"
    },
    "name": "badbit_call_operation"
  }
}

Python

Python
import badbit

result = badbit.cad.format.table_style(data_height=2.5, header_height=3, name="Quadro", title_height=4)

LISP

LISP
(badbit-call "cad.format.table_style" '(("data_height" . 2.5) ("header_height" . 3) ("name" . "Quadro") ("title_height" . 4)))

JSON-RPC

JSON
{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "badbit/call",
  "params": {
    "arguments": {
      "data_height": 2.5,
      "header_height": 3,
      "name": "Quadro",
      "title_height": 4
    },
    "operation": "cad.format.table_style"
  }
}

Comandos que hacen lo mismo

TABLESTYLE

Esquema completo

JSON Schema 2020-12, con las descripciones en inglés.

Parámetros (entrada)
JSON
{
  "$defs": {
    "Direction": {
      "oneOf": [
        {
          "const": "down",
          "type": "string"
        },
        {
          "const": "up",
          "type": "string"
        }
      ]
    }
  },
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "additionalProperties": false,
  "properties": {
    "data_height": {
      "default": null,
      "description": "The text height of the data.",
      "format": "double",
      "type": [
        "number",
        "null"
      ]
    },
    "direction": {
      "anyOf": [
        {
          "$ref": "#/$defs/Direction"
        },
        {
          "type": "null"
        }
      ],
      "description": "Where the table rows grow: down or up."
    },
    "header_height": {
      "default": null,
      "description": "The text height of the header.",
      "format": "double",
      "type": [
        "number",
        "null"
      ]
    },
    "name": {
      "description": "Name (of the layer, of the system variable or of the command, depending on the operation).",
      "maxLength": 255,
      "minLength": 1,
      "type": "string"
    },
    "set_current": {
      "default": false,
      "description": "Makes the style the current one.",
      "type": "boolean"
    },
    "text_style": {
      "default": null,
      "description": "The text style.",
      "type": [
        "string",
        "null"
      ]
    },
    "title_height": {
      "default": null,
      "description": "The text height of the title.",
      "format": "double",
      "type": [
        "number",
        "null"
      ]
    }
  },
  "required": [
    "name"
  ],
  "type": "object"
}
Resultado (salida)
JSON
{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "properties": {
    "is_current": {
      "description": "It is (or became) the current one.",
      "type": "boolean"
    },
    "style_created": {
      "description": "The style was created now (otherwise it already existed and changed).",
      "type": "boolean"
    },
    "updated_objects": {
      "description": "How many objects using the style were redrawn.",
      "format": "uint",
      "minimum": 0,
      "type": "integer"
    }
  },
  "required": [
    "style_created",
    "updated_objects",
    "is_current"
  ],
  "type": "object"
}
Buscar en la documentación