Skip to content
BadBit Documentation
Sign in Download the beta

BadBit CAD operations

cad.annotate.dim_arc

Arc length dimension (DIMARC).

  • Program: BadBit CAD
  • Type of action: Changes the drawing
  • Changes the drawing
  • Since version 2027.0.0-beta.8

Creates the DIMARC arc length dimension on the arc arc, with the dimension arc through dim_line_point; arc_leader adds the leader to the arc (the Leader option). dim_text and text_angle are optional. Returns the identifier and the text. 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

NameTypeRequiredDescription
arcstringYesThe identifier of an arc.
arc_leaderbooleanNoAdds the leader to the arc (the Leader option).
dim_line_pointarray<number>YesA point [x, y] the dimension line (or arc) passes through; in radial and ordinate dimensions, where the text goes.
dim_textstring | nullNoThe dimension text (<> is the measurement; without it, the measurement).
text_anglenumber | nullNoThe angle of the dimension text, in degrees.

Errors

CodeJSON-RPCMeaning
invalid_params-32602The parameters do not follow the schema or a rule of the operation.
not_found-32001The object, operation, file or name does not exist.
conflict-32004The current state does not allow this now.
failed-32005The operation failed.

Example

MCP

JSON
{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {
      "arguments": {
        "arc": "0190f3a2b4c5d6e7f8091a2b3c4d5e6f",
        "dim_line_point": [
          0,
          12
        ]
      },
      "operation": "cad.annotate.dim_arc"
    },
    "name": "badbit_call_operation"
  }
}

Python

Python
import badbit

result = badbit.cad.annotate.dim_arc(arc="0190f3a2b4c5d6e7f8091a2b3c4d5e6f", dim_line_point=[0, 12])

LISP

LISP
(badbit-call "cad.annotate.dim_arc" '(("arc" . "0190f3a2b4c5d6e7f8091a2b3c4d5e6f") ("dim_line_point" . (0 12))))

JSON-RPC

JSON
{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "badbit/call",
  "params": {
    "arguments": {
      "arc": "0190f3a2b4c5d6e7f8091a2b3c4d5e6f",
      "dim_line_point": [
        0,
        12
      ]
    },
    "operation": "cad.annotate.dim_arc"
  }
}

Commands that do the same

DIMARC

Full schema

JSON Schema 2020-12.

Parameters (input)
JSON
{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "additionalProperties": false,
  "properties": {
    "arc": {
      "description": "The identifier of an arc.",
      "type": "string"
    },
    "arc_leader": {
      "default": false,
      "description": "Adds the leader to the arc (the Leader option).",
      "type": "boolean"
    },
    "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"
      ]
    },
    "text_angle": {
      "default": null,
      "description": "The angle of the dimension text, in degrees.",
      "format": "double",
      "type": [
        "number",
        "null"
      ]
    }
  },
  "required": [
    "arc",
    "dim_line_point"
  ],
  "type": "object"
}
Result (output)
JSON
{
  "$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"
}
Search the documentation