Operações do BadBit CAD
cad.quick_properties.set
Escolhe as linhas das Propriedades rápidas de um tipo de objeto (CUI).
- Programa: BadBit CAD
- Tipo de ação: Age fora do desenho
- Altera o desenho
- Desde a versão 2027.0.0-beta.8
Troca as linhas que as Propriedades rápidas mostram para o tipo type pelas shown_rows (das possible_rows do cad.quick_properties.list, na ordem da paleta), ou volta às do AutoCAD com reset, como o OK da parte Propriedades rápidas do CUI. Vale na hora e vai para o perfil; não entra no desfazer nem no lote. Devolve as linhas do tipo.
Parâmetros
| Nome | Tipo | Obrigatório | Descrição |
|---|---|---|---|
reset | boolean | Não | Volta à lista padrão antes do resto. |
shown_rows | array<string> | null | Não | As linhas mostradas, na ordem (os identificadores). |
type | string | Sim | Tipo do objeto: line, polyline, circle, arc, point ou text para criar; nos resultados também mtext, ellipse, spline, insert, hatch, dimension e outros. |
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. |
permission_denied | -32002 | O pedido não é aceito (o detalhe diz por quê). |
conflict | -32004 | O estado atual não permite isso agora. |
Exemplo
MCP
JSON
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"arguments": {
"shown_rows": [
"props-layer",
"props-radius",
"props-area"
],
"type": "circle"
},
"operation": "cad.quick_properties.set"
},
"name": "badbit_call_operation"
}
}Python
Python
import badbit
result = badbit.cad.quick_properties.set(shown_rows=["props-layer", "props-radius", "props-area"], type="circle")LISP
LISP
(badbit-call "cad.quick_properties.set" '(("shown_rows" . ("props-layer" "props-radius" "props-area")) ("type" . "circle")))JSON-RPC
JSON
{
"id": 1,
"jsonrpc": "2.0",
"method": "badbit/call",
"params": {
"arguments": {
"shown_rows": [
"props-layer",
"props-radius",
"props-area"
],
"type": "circle"
},
"operation": "cad.quick_properties.set"
}
}Comandos que fazem o mesmo
Esquema completo
JSON Schema 2020-12, com as descrições em inglês.
Parâmetros (entrada)
JSON
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"additionalProperties": false,
"properties": {
"reset": {
"default": false,
"description": "Goes back to the default list before the rest.",
"type": "boolean"
},
"shown_rows": {
"default": null,
"description": "The rows shown, in order (the identifiers).",
"items": {
"type": "string"
},
"maxItems": 200,
"type": [
"array",
"null"
]
},
"type": {
"description": "Object type: line, polyline, circle, arc, point or text to create; in results also mtext, ellipse, spline, insert, hatch, dimension and others.",
"maxLength": 64,
"minLength": 1,
"type": "string"
}
},
"required": [
"type"
],
"type": "object"
}Resultado (saída)
JSON
{
"$defs": {
"QuickPropertiesRow": {
"properties": {
"label": {
"description": "The name, in English.",
"type": "string"
},
"row_id": {
"description": "The identifier of the Quick Properties row.",
"type": "string"
}
},
"required": [
"row_id",
"label"
],
"type": "object"
},
"QuickPropertiesType": {
"properties": {
"customized": {
"description": "The type has the person's choice (otherwise, the AutoCAD default rows).",
"type": "boolean"
},
"possible_rows": {
"description": "The rows that can be chosen for the type.",
"items": {
"$ref": "#/$defs/QuickPropertiesRow"
},
"type": "array"
},
"shown_rows": {
"description": "The rows shown, in order (the identifiers).",
"items": {
"$ref": "#/$defs/QuickPropertiesRow"
},
"type": "array"
},
"type": {
"description": "Object type: line, polyline, circle, arc, point or text to create; in results also mtext, ellipse, spline, insert, hatch, dimension and others.",
"type": "string"
}
},
"required": [
"type",
"shown_rows",
"possible_rows",
"customized"
],
"type": "object"
}
},
"$schema": "https://json-schema.org/draft/2020-12/schema",
"properties": {
"types": {
"description": "Only objects of these types (line, polyline, circle, arc, point, text, mtext, insert, hatch, dimension…).",
"items": {
"$ref": "#/$defs/QuickPropertiesType"
},
"type": "array"
}
},
"required": [
"types"
],
"type": "object"
}