Operaciones de BadBit CAD
cad.format.mleader_style
Crea o cambia un estilo de directriz múltiple (MLEADERSTYLE).
- 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 directriz name (a partir del actual) o cambia el que existe, como la ventana de MLEADERSTYLE: text_style, text_height, arrow_size, landing, dogleg, landing_gap, overall_scale y annotative. Las directrices que usan el estilo se redibujan. set_current lo vuelve el actual. Devuelve si se creó y cuántos objetos cambiaron.
Parámetros
| Nombre | Tipo | Obligatorio | Descripción |
|---|---|---|---|
annotative | boolean | null | No | El estilo es anotativo. |
arrow_size | number | null | No | El tamaño de la flecha. |
dogleg | number | null | No | La longitud del rellano. |
landing | boolean | null | No | Con el rellano horizontal. |
landing_gap | number | null | No | La distancia del rellano al texto. |
name | string | Sí | Nombre (de la capa, de la variable de sistema o del comando, según la operación). |
overall_scale | number | null | No | La escala global del estilo. |
set_current | boolean | No | Vuelve el estilo el actual. |
text_height | number | null | No | La altura del texto. |
text_style | string | null | No | El estilo de texto. |
Errores
| Código | JSON-RPC | Qué significa |
|---|---|---|
invalid_params | -32602 | Los parámetros no siguen el esquema o una regla de la operación. |
not_found | -32001 | El objeto, la operación, el archivo o el nombre no existe. |
conflict | -32004 | El estado actual no lo permite ahora. |
failed | -32005 | La operación falló. |
Ejemplo
MCP
JSON
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"arguments": {
"arrow_size": 2,
"name": "Notas",
"set_current": true,
"text_height": 2.5
},
"operation": "cad.format.mleader_style"
},
"name": "badbit_call_operation"
}
}Python
Python
import badbit
result = badbit.cad.format.mleader_style(arrow_size=2, name="Notas", set_current=True, text_height=2.5)LISP
LISP
(badbit-call "cad.format.mleader_style" '(("arrow_size" . 2) ("name" . "Notas") ("set_current" . T) ("text_height" . 2.5)))JSON-RPC
JSON
{
"id": 1,
"jsonrpc": "2.0",
"method": "badbit/call",
"params": {
"arguments": {
"arrow_size": 2,
"name": "Notas",
"set_current": true,
"text_height": 2.5
},
"operation": "cad.format.mleader_style"
}
}Comandos que hacen lo mismo
Esquema completo
JSON Schema 2020-12, con las descripciones en inglés.
Parámetros (entrada)
JSON
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"additionalProperties": false,
"properties": {
"annotative": {
"default": null,
"description": "The style is annotative.",
"type": [
"boolean",
"null"
]
},
"arrow_size": {
"default": null,
"description": "The arrowhead size.",
"format": "double",
"type": [
"number",
"null"
]
},
"dogleg": {
"default": null,
"description": "The landing length.",
"format": "double",
"type": [
"number",
"null"
]
},
"landing": {
"default": null,
"description": "With the horizontal landing.",
"type": [
"boolean",
"null"
]
},
"landing_gap": {
"default": null,
"description": "The distance from the landing to the text.",
"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"
},
"overall_scale": {
"default": null,
"description": "The overall scale of the style.",
"format": "double",
"type": [
"number",
"null"
]
},
"set_current": {
"default": false,
"description": "Makes the style the current one.",
"type": "boolean"
},
"text_height": {
"default": null,
"description": "The text height.",
"format": "double",
"type": [
"number",
"null"
]
},
"text_style": {
"default": null,
"description": "The text style.",
"type": [
"string",
"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"
}