Operaciones de BadBit CAD
cad.annotate.scale_text
Cambia la altura de textos sin moverlos (SCALETEXT y TSCALE).
- Programa: BadBit CAD
- Tipo de acción: Cambia el dibujo
- Modifica el dibujo
- Desde la versión 2027.0.0-beta.8
Cambia el tamaño de los textos ids con el punto anchor fijo (existing: el punto de justificación de cada uno, por defecto; o uno de los puntos del cuadro). Dé solo uno: height (la altura en el modelo; solo cambian los no anotativos), paper_height (la altura en el papel; solo los anotativos), scale_factor (todos), final_height (la altura final de todos, como TSCALE) o match_text (la altura de otro texto, la opción Igualar objeto). Devuelve lo que cambió. Con objetos del papel, las coordenadas y las medidas son en mm (los objetos del modelo y del papel en la misma petición se rechazan); los ángulos y los factores de escala no cambian.
Parámetros
| Nombre | Tipo | Obligatorio | Descripción |
|---|---|---|---|
anchor | BaseSpec | No | El punto que queda fijo en cada texto: existing (el de justificación) o left, center, middle, right, top_left, top_center, top_right, middle_left, middle_center, middle_right, bottom_left, bottom_center, bottom_right. |
final_height | number | null | No | La altura final de todos los textos. |
height | number | null | No | La altura del texto; en el zoom, la altura visible; en las imágenes, la altura en píxeles; en la vista guardada, en unidades del dibujo; en la ventana gráfica, la altura del modelo que muestra, en unidades del dibujo. |
ids | array<string> | Sí | Identificadores de objetos (32 dígitos hexadecimales cada uno). |
match_text | string | null | No | El identificador del texto cuya altura copian los demás. |
paper_height | number | null | No | La altura en el papel (solo cambian los objetos anotativos). |
scale_factor | number | null | No | Factor de escala, mayor que cero (2 duplica, 0.5 reduce a la mitad). |
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
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"arguments": {
"height": 0.25,
"ids": [
"0190f3a2b4c5d6e7f8091a2b3c4d5e6f"
]
},
"operation": "cad.annotate.scale_text"
},
"name": "badbit_call_operation"
}
}Python
import badbit
result = badbit.cad.annotate.scale_text(height=0.25, ids=["0190f3a2b4c5d6e7f8091a2b3c4d5e6f"])LISP
(badbit-call "cad.annotate.scale_text" '(("height" . 0.25) ("ids" . ("0190f3a2b4c5d6e7f8091a2b3c4d5e6f"))))JSON-RPC
{
"id": 1,
"jsonrpc": "2.0",
"method": "badbit/call",
"params": {
"arguments": {
"height": 0.25,
"ids": [
"0190f3a2b4c5d6e7f8091a2b3c4d5e6f"
]
},
"operation": "cad.annotate.scale_text"
}
}Comandos que hacen lo mismo
Esquema completo
JSON Schema 2020-12, con las descripciones en inglés.
Parámetros (entrada)
{
"$defs": {
"BaseSpec": {
"oneOf": [
{
"const": "existing",
"type": "string"
},
{
"const": "left",
"type": "string"
},
{
"const": "center",
"type": "string"
},
{
"const": "middle",
"type": "string"
},
{
"const": "right",
"type": "string"
},
{
"const": "top_left",
"type": "string"
},
{
"const": "top_center",
"type": "string"
},
{
"const": "top_right",
"type": "string"
},
{
"const": "middle_left",
"type": "string"
},
{
"const": "middle_center",
"type": "string"
},
{
"const": "middle_right",
"type": "string"
},
{
"const": "bottom_left",
"type": "string"
},
{
"const": "bottom_center",
"type": "string"
},
{
"const": "bottom_right",
"type": "string"
}
]
}
},
"$schema": "https://json-schema.org/draft/2020-12/schema",
"additionalProperties": false,
"properties": {
"anchor": {
"$ref": "#/$defs/BaseSpec",
"description": "The point that stays fixed on each text: existing (the justification point) or left, center, middle, right, top_left, top_center, top_right, middle_left, middle_center, middle_right, bottom_left, bottom_center, bottom_right."
},
"final_height": {
"default": null,
"description": "The final height of all texts.",
"format": "double",
"type": [
"number",
"null"
]
},
"height": {
"default": null,
"description": "Text height; in zoom, the visible height; in images, the height in pixels; in a named view, in drawing units; in a layout viewport, the height of the model it shows, in drawing units.",
"format": "double",
"type": [
"number",
"null"
]
},
"ids": {
"description": "Object identifiers (32 hexadecimal digits each).",
"items": {
"type": "string"
},
"maxItems": 200000,
"minItems": 1,
"type": "array"
},
"match_text": {
"default": null,
"description": "The identifier of the text whose height the others copy.",
"type": [
"string",
"null"
]
},
"paper_height": {
"default": null,
"description": "The paper height (only annotative objects change).",
"format": "double",
"type": [
"number",
"null"
]
},
"scale_factor": {
"default": null,
"description": "Scale factor, greater than zero (2 doubles, 0.5 halves).",
"format": "double",
"type": [
"number",
"null"
]
}
},
"required": [
"ids"
],
"type": "object"
}Resultado (salida)
{
"$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"
},
"modified": {
"description": "Whether there are unsaved changes; in results of changes, the identifiers of the objects changed.",
"items": {
"type": "string"
},
"type": "array"
},
"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": [
"created",
"modified",
"deleted",
"document_changed",
"truncated"
],
"type": "object"
}