Pular para o conteúdo
BadBit Documentação
Entrar Baixar o beta

Operações do BadBit CAD

cad.format.table_style

Cria ou muda um estilo de tabela (TABLESTYLE).

  • Programa: BadBit CAD
  • Tipo de ação: Altera o desenho
  • Altera o desenho
  • Desde a versão 2027.0.0-beta.8

Cria o estilo de tabela name (a partir do atual) ou muda o que existe, como a janela do TABLESTYLE: direction (down ou up), text_style das células e as alturas do texto do título (title_height), do cabeçalho (header_height) e dos dados (data_height). As tabelas que usam o estilo são redesenhadas. set_current torna o estilo o atual. Devolve se foi criado e quantas tabelas mudaram.

Parâmetros

NomeTipoObrigatórioDescrição
data_heightnumber | nullNãoA altura do texto dos dados.
directionDirection | nullNãoPara onde as linhas da tabela crescem: down ou up.
header_heightnumber | nullNãoA altura do texto do cabeçalho.
namestringSimNome (da camada, da variável de sistema ou do comando, conforme a operação).
set_currentbooleanNãoTorna o estilo o atual.
text_stylestring | nullNãoO estilo de texto.
title_heightnumber | nullNãoA altura do texto do título.

Erros

CódigoJSON-RPCO que significa
invalid_params-32602Os parâmetros não seguem o esquema ou uma regra da operação.
not_found-32001O objeto, a operação, o arquivo ou o nome não existe.
conflict-32004O estado atual não permite isso agora.
failed-32005A operação falhou.

Exemplo

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 fazem o mesmo

TABLESTYLE

Esquema completo

JSON Schema 2020-12, com as descrições em 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 (saída)
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 na documentação