Skip to content
BadBit Documentation
Sign in Download the beta

BadBit CAD operations

cad.format.mleader_style

Creates or changes a multileader style (MLEADERSTYLE).

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

Creates the multileader style name (from the current one) or changes the existing one, like the MLEADERSTYLE dialog: text_style, text_height, arrow_size, landing, dogleg, landing_gap, overall_scale and annotative. Leaders using the style are redrawn. set_current makes it the current style. Returns whether it was created and how many objects changed.

Parameters

NameTypeRequiredDescription
annotativeboolean | nullNoThe style is annotative.
arrow_sizenumber | nullNoThe arrowhead size.
doglegnumber | nullNoThe landing length.
landingboolean | nullNoWith the horizontal landing.
landing_gapnumber | nullNoThe distance from the landing to the text.
namestringYesName (of the layer, of the system variable or of the command, depending on the operation).
overall_scalenumber | nullNoThe overall scale of the style.
set_currentbooleanNoMakes the style the current one.
text_heightnumber | nullNoThe text height.
text_stylestring | nullNoThe text style.

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": {
        "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"
  }
}

Commands that do the same

MLEADERSTYLE

Full schema

JSON Schema 2020-12.

Parameters (input)
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"
}
Result (output)
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"
}
Search the documentation