Operações do BadBit CAD
cad.block.property_table
Monta a tabela de propriedades de um bloco dinâmico (BTABLE).
- Programa: BadBit CAD
- Tipo de ação: Altera o desenho
- Altera o desenho
- Desde a versão 2027.0.0-beta.8
Troca a tabela de propriedades do bloco name (criada em table_location, ou no ponto base, na primeira vez): table_columns são os parâmetros (o node ou o rótulo) e table_rows as linhas, um texto por coluna (números, ângulos em graus, x,y, o nome do estado; vazio vale), conferido com cada parâmetro; must_match (padrão sim) exige que as propriedades batam com uma linha, como o BTABLE. Cada inserção escolhe a linha com cad.block.dynamic_set (o número da linha, a partir de 1). Um passo do desfazer. Devolve o que mudou (e o node da tabela criada).
Parâmetros
| Nome | Tipo | Obrigatório | Descrição |
|---|---|---|---|
must_match | boolean | null | Não | As propriedades têm de bater com uma linha da tabela (falso: aceita valores fora dela). |
name | string | Sim | Nome (da camada, da variável de sistema ou do comando, conforme a operação). |
table_columns | array<DynNodeRef> | Sim | Os parâmetros das colunas da tabela (o node ou o rótulo; nos resultados, o node). |
table_location | array<number> | null | Não | O lugar [x, y] do grip da tabela de propriedades. |
table_rows | array<array<string>> | Sim | As linhas da tabela, um texto por coluna (números, ângulos em graus, x,y, o nome do estado). |
Erros
| Código | JSON-RPC | O que significa |
|---|---|---|
invalid_params | -32602 | Os parâmetros não seguem o esquema ou uma regra da operação. |
not_found | -32001 | O objeto, a operação, o arquivo ou o nome não existe. |
conflict | -32004 | O estado atual não permite isso agora. |
failed | -32005 | A operação falhou. |
Exemplo
MCP
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"arguments": {
"name": "Door",
"table_columns": [
"Width"
],
"table_rows": [
[
"700"
],
[
"800"
],
[
"900"
]
]
},
"operation": "cad.block.property_table"
},
"name": "badbit_call_operation"
}
}Python
import badbit
result = badbit.cad.block.property_table(name="Door", table_columns=["Width"], table_rows=[["700"], ["800"], ["900"]])LISP
(badbit-call "cad.block.property_table" '(("name" . "Door") ("table_columns" . ("Width")) ("table_rows" . (("700") ("800") ("900")))))JSON-RPC
{
"id": 1,
"jsonrpc": "2.0",
"method": "badbit/call",
"params": {
"arguments": {
"name": "Door",
"table_columns": [
"Width"
],
"table_rows": [
[
"700"
],
[
"800"
],
[
"900"
]
]
},
"operation": "cad.block.property_table"
}
}Comandos que fazem o mesmo
Esquema completo
JSON Schema 2020-12, com as descrições em inglês.
Parâmetros (entrada)
{
"$defs": {
"DynNodeRef": {
"anyOf": [
{
"format": "uint32",
"minimum": 0,
"type": "integer"
},
{
"type": "string"
}
]
}
},
"$schema": "https://json-schema.org/draft/2020-12/schema",
"additionalProperties": false,
"properties": {
"must_match": {
"default": null,
"description": "The properties must match a table row (false: accepts values outside it).",
"type": [
"boolean",
"null"
]
},
"name": {
"description": "Name (of the layer, of the system variable or of the command, depending on the operation).",
"type": "string"
},
"table_columns": {
"description": "The table column parameters (the node or the label; in results, the node).",
"items": {
"$ref": "#/$defs/DynNodeRef"
},
"maxItems": 100,
"type": "array"
},
"table_location": {
"default": null,
"description": "The location [x, y] of the property table grip.",
"items": {
"format": "double",
"type": "number"
},
"maxItems": 2,
"minItems": 2,
"type": [
"array",
"null"
]
},
"table_rows": {
"description": "The table rows, one text per column (numbers, angles in degrees, x,y, the state name).",
"items": {
"items": {
"type": "string"
},
"type": "array"
},
"maxItems": 10000,
"type": "array"
}
},
"required": [
"name",
"table_columns",
"table_rows"
],
"type": "object"
}Resultado (saída)
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"properties": {
"created": {
"description": "Identifiers of the objects created.",
"items": {
"type": "string"
},
"type": "array"
},
"deleted": {
"description": "The identifiers of what was deleted.",
"items": {
"type": "string"
},
"type": "array"
},
"document_changed": {
"description": "The drawing on screen is another one (opened, closed or changed tab): the lists of changes do not apply.",
"type": "boolean"
},
"inserts_changed": {
"description": "How many inserts of the block changed.",
"format": "uint",
"minimum": 0,
"type": "integer"
},
"modified": {
"description": "Whether there are unsaved changes; in results of changes, the identifiers of the objects changed.",
"items": {
"type": "string"
},
"type": "array"
},
"node": {
"description": "The node number of the parameter or action (what the other dynamic block operations use).",
"format": "uint32",
"minimum": 0,
"type": [
"integer",
"null"
]
},
"skipped_locked": {
"description": "Objects left as they were because they are on locked layers.",
"format": "uint",
"minimum": 0,
"type": "integer"
},
"truncated": {
"description": "The lists were cut at the limit.",
"type": "boolean"
}
},
"required": [
"inserts_changed",
"created",
"modified",
"deleted",
"document_changed",
"truncated"
],
"type": "object"
}