Pular para o conteúdo
BadBit Documentação
Entrar Baixar o beta

Operações do BadBit CAD

cad.annotate.dim_jogged

Cota de raio com quebra (DIMJOGGED).

  • Programa: BadBit CAD
  • Tipo de ação: Altera o desenho
  • Altera o desenho
  • Desde a versão 2027.0.0-beta.8

Cria a cota de raio quebrada do DIMJOGGED no arco ou círculo curve: a linha de cota sai de center_override (o centro trocado), passa por dim_line_point e tem a quebra em jog_point. dim_text e text_angle opcionais. Devolve o identificador e o texto. Com objetos do papel, as coordenadas e as medidas são em mm (objetos do modelo e do papel no mesmo pedido são recusados); os ângulos e os fatores de escala não mudam.

Parâmetros

NomeTipoObrigatórioDescrição
center_overridearray<number>SimO centro trocado [x, y], de onde sai a linha de cota quebrada.
curvestringSimO identificador de um arco ou círculo (numa polilinha, o trecho em arco mais perto).
dim_line_pointarray<number>SimUm ponto [x, y] por onde passa a linha (ou o arco) de cota; nas de raio e na ordenada, onde fica o texto.
dim_textstring | nullNãoO texto da cota (<> é a medida; sem ele, a medida).
jog_pointarray<number>SimO ponto [x, y] da quebra.
text_anglenumber | nullNãoO ângulo do texto da cota, em graus.

Erros

CódigoJSON-RPCO que significa
invalid_params-32602Os parâmetros não seguem o esquema ou uma regra da operação.
not_found-32001O objeto, a operação, o arquivo ou o nome não existe.
conflict-32004O estado atual não permite isso agora.
failed-32005A operação falhou.

Exemplo

MCP

JSON
{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {
      "arguments": {
        "center_override": [
          30,
          0
        ],
        "curve": "0190f3a2b4c5d6e7f8091a2b3c4d5e6f",
        "dim_line_point": [
          8,
          6
        ],
        "jog_point": [
          20,
          5
        ]
      },
      "operation": "cad.annotate.dim_jogged"
    },
    "name": "badbit_call_operation"
  }
}

Python

Python
import badbit

result = badbit.cad.annotate.dim_jogged(center_override=[30, 0], curve="0190f3a2b4c5d6e7f8091a2b3c4d5e6f", dim_line_point=[8, 6], jog_point=[20, 5])

LISP

LISP
(badbit-call "cad.annotate.dim_jogged" '(("center_override" . (30 0)) ("curve" . "0190f3a2b4c5d6e7f8091a2b3c4d5e6f") ("dim_line_point" . (8 6)) ("jog_point" . (20 5))))

JSON-RPC

JSON
{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "badbit/call",
  "params": {
    "arguments": {
      "center_override": [
        30,
        0
      ],
      "curve": "0190f3a2b4c5d6e7f8091a2b3c4d5e6f",
      "dim_line_point": [
        8,
        6
      ],
      "jog_point": [
        20,
        5
      ]
    },
    "operation": "cad.annotate.dim_jogged"
  }
}

Comandos que fazem o mesmo

DIMJOGGED

Esquema completo

JSON Schema 2020-12, com as descrições em inglês.

Parâmetros (entrada)
JSON
{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "additionalProperties": false,
  "properties": {
    "center_override": {
      "description": "The overridden center [x, y] the jogged dimension line starts from.",
      "items": {
        "format": "double",
        "type": "number"
      },
      "maxItems": 2,
      "minItems": 2,
      "type": "array"
    },
    "curve": {
      "description": "The identifier of an arc or circle (on a polyline, the nearest arc segment).",
      "type": "string"
    },
    "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"
      ]
    },
    "jog_point": {
      "description": "The jog point [x, y].",
      "items": {
        "format": "double",
        "type": "number"
      },
      "maxItems": 2,
      "minItems": 2,
      "type": "array"
    },
    "text_angle": {
      "default": null,
      "description": "The angle of the dimension text, in degrees.",
      "format": "double",
      "type": [
        "number",
        "null"
      ]
    }
  },
  "required": [
    "curve",
    "center_override",
    "jog_point",
    "dim_line_point"
  ],
  "type": "object"
}
Resultado (saída)
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"
}
Buscar na documentação