BadBit CAD operations
cad.annotate.scale_text
Changes the height of texts without moving them (SCALETEXT and TSCALE).
- Program: BadBit CAD
- Type of action: Changes the drawing
- Changes the drawing
- Since version 2027.0.0-beta.8
Changes the size of the texts ids with the point anchor fixed (existing: the justification point of each, the default; or one of the points of the box). Give only one: height (the model height; only non-annotative ones change), paper_height (the paper height; only annotative ones), scale_factor (all), final_height (the final height of all, like TSCALE) or match_text (the height of another text, the Match object option). Returns what changed. With paper space objects, the coordinates and the measures are in mm (model and paper space objects in the same request are refused); angles and scale factors do not change.
Parameters
| Name | Type | Required | Description |
|---|---|---|---|
anchor | BaseSpec | No | 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 | number | null | No | The final height of all texts. |
height | number | null | No | 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. |
ids | array<string> | Yes | Object identifiers (32 hexadecimal digits each). |
match_text | string | null | No | The identifier of the text whose height the others copy. |
paper_height | number | null | No | The paper height (only annotative objects change). |
scale_factor | number | null | No | Scale factor, greater than zero (2 doubles, 0.5 halves). |
Errors
| Code | JSON-RPC | Meaning |
|---|---|---|
invalid_params | -32602 | The parameters do not follow the schema or a rule of the operation. |
not_found | -32001 | The object, operation, file or name does not exist. |
conflict | -32004 | The current state does not allow this now. |
failed | -32005 | The operation failed. |
Example
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"
}
}Commands that do the same
Full schema
JSON Schema 2020-12.
Parameters (input)
{
"$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"
}Result (output)
{
"$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"
}