BadBit CAD operations
cad.annotate.dim_angular
Angular dimension (DIMANGULAR) by three points, two lines or an arc.
- Program: BadBit CAD
- Type of action: Changes the drawing
- Changes the drawing
- Since version 2027.0.0-beta.8
Creates the DIMANGULAR angular dimension: by angle_vertex, angle_start and angle_end; between the two lines of lines; or the angle of the arc arc. dim_line_point is where the dimension arc passes (it picks the quadrant). The given objects associate the dimension (DIMASSOC 2). dim_text and text_angle are optional. Returns the identifier and the text. In paper space, the coordinates and the measures are in mm: with objects given, when they are in paper space; without them, with a layout on screen outside the viewports. Angles and scale factors do not change.
Parameters
| Name | Type | Required | Description |
|---|---|---|---|
angle_end | array<number> | null | No | The second endpoint [x, y] of the angle. |
angle_start | array<number> | null | No | The first endpoint [x, y] of the angle. |
angle_vertex | array<number> | null | No | The vertex [x, y] of the angle. |
arc | string | null | No | The identifier of an arc. |
dim_line_point | array<number> | Yes | A point [x, y] the dimension line (or arc) passes through; in radial and ordinate dimensions, where the text goes. |
dim_text | string | null | No | The dimension text (<> is the measurement; without it, the measurement). |
lines | array<string> | null | No | The identifiers of two lines. |
text_angle | number | null | No | The angle of the dimension text, in degrees. |
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": {
"angle_end": [
0,
10
],
"angle_start": [
10,
0
],
"angle_vertex": [
0,
0
],
"dim_line_point": [
5,
5
]
},
"operation": "cad.annotate.dim_angular"
},
"name": "badbit_call_operation"
}
}Python
import badbit
result = badbit.cad.annotate.dim_angular(angle_end=[0, 10], angle_start=[10, 0], angle_vertex=[0, 0], dim_line_point=[5, 5])LISP
(badbit-call "cad.annotate.dim_angular" '(("angle_end" . (0 10)) ("angle_start" . (10 0)) ("angle_vertex" . (0 0)) ("dim_line_point" . (5 5))))JSON-RPC
{
"id": 1,
"jsonrpc": "2.0",
"method": "badbit/call",
"params": {
"arguments": {
"angle_end": [
0,
10
],
"angle_start": [
10,
0
],
"angle_vertex": [
0,
0
],
"dim_line_point": [
5,
5
]
},
"operation": "cad.annotate.dim_angular"
}
}Commands that do the same
Full schema
JSON Schema 2020-12.
Parameters (input)
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"additionalProperties": false,
"properties": {
"angle_end": {
"default": null,
"description": "The second endpoint [x, y] of the angle.",
"items": {
"format": "double",
"type": "number"
},
"maxItems": 2,
"minItems": 2,
"type": [
"array",
"null"
]
},
"angle_start": {
"default": null,
"description": "The first endpoint [x, y] of the angle.",
"items": {
"format": "double",
"type": "number"
},
"maxItems": 2,
"minItems": 2,
"type": [
"array",
"null"
]
},
"angle_vertex": {
"default": null,
"description": "The vertex [x, y] of the angle.",
"items": {
"format": "double",
"type": "number"
},
"maxItems": 2,
"minItems": 2,
"type": [
"array",
"null"
]
},
"arc": {
"default": null,
"description": "The identifier of an arc.",
"type": [
"string",
"null"
]
},
"dim_line_point": {
"description": "A point [x, y] the dimension line (or arc) passes through; in radial and ordinate dimensions, where the text goes.",
"items": {
"format": "double",
"type": "number"
},
"maxItems": 2,
"minItems": 2,
"type": "array"
},
"dim_text": {
"default": null,
"description": "The dimension text (<> is the measurement; without it, the measurement).",
"maxLength": 10000,
"type": [
"string",
"null"
]
},
"lines": {
"default": null,
"description": "The identifiers of two lines.",
"items": {
"type": "string"
},
"maxItems": 2,
"minItems": 2,
"type": [
"array",
"null"
]
},
"text_angle": {
"default": null,
"description": "The angle of the dimension text, in degrees.",
"format": "double",
"type": [
"number",
"null"
]
}
},
"required": [
"dim_line_point"
],
"type": "object"
}Result (output)
{
"$defs": {
"DimLinkOut": {
"properties": {
"definition_point": {
"description": "The linked definition point (the index in definition_points).",
"format": "uint",
"minimum": 0,
"type": "integer"
},
"link_type": {
"description": "Where the point is on the object: endpoint, midpoint, center, quadrant, node, insertion, on_curve, intersection, lines_meet or nearest (any point on the object, from the Nearest snap, which follows the object in the same proportion).",
"type": "string"
},
"object_ids": {
"description": "The objects the point is linked to (at an intersection, both).",
"items": {
"type": "string"
},
"type": "array"
}
},
"required": [
"definition_point",
"object_ids",
"link_type"
],
"type": "object"
}
},
"$schema": "https://json-schema.org/draft/2020-12/schema",
"properties": {
"dim_texts": {
"description": "The text each dimension shows.",
"items": {
"type": "string"
},
"type": "array"
},
"ids": {
"description": "Object identifiers (32 hexadecimal digits each).",
"items": {
"type": "string"
},
"type": "array"
},
"links": {
"description": "The definition points linked to objects (DIMASSOC 2): when the object changes, the dimension follows. Empty: the dimension is not associative.",
"items": {
"items": {
"$ref": "#/$defs/DimLinkOut"
},
"type": "array"
},
"type": "array"
}
},
"required": [
"ids",
"dim_texts",
"links"
],
"type": "object"
}