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

Operações do BadBit CAD

cad.annotate.dim_ordinate

Cota ordenada (DIMORDINATE) de um ponto.

  • 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 ordenada do DIMORDINATE do ponto feature, com a chamada até leader_end; datum x ou y escolhe a coordenada (sem ele, pela direção da chamada, como o cursor no comando). A origem e os eixos são os do UCS atual. dim_text opcional. Devolve o identificador e o texto. No papel (um layout à vista, fora das janelas de vista), as coordenadas e as medidas são em mm; os ângulos e os fatores de escala não mudam.

Parâmetros

NomeTipoObrigatórioDescrição
datumDatum | nullNãoA coordenada da ordenada: x ou y.
dim_textstring | nullNãoO texto da cota (<> é a medida; sem ele, a medida).
featurearray<number>SimO ponto [x, y] cotado.
leader_endarray<number>SimA ponta [x, y] da chamada, onde fica o texto.

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": {
        "datum": "x",
        "feature": [
          10,
          5
        ],
        "leader_end": [
          10,
          12
        ]
      },
      "operation": "cad.annotate.dim_ordinate"
    },
    "name": "badbit_call_operation"
  }
}

Python

Python
import badbit

result = badbit.cad.annotate.dim_ordinate(datum="x", feature=[10, 5], leader_end=[10, 12])

LISP

LISP
(badbit-call "cad.annotate.dim_ordinate" '(("datum" . "x") ("feature" . (10 5)) ("leader_end" . (10 12))))

JSON-RPC

JSON
{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "badbit/call",
  "params": {
    "arguments": {
      "datum": "x",
      "feature": [
        10,
        5
      ],
      "leader_end": [
        10,
        12
      ]
    },
    "operation": "cad.annotate.dim_ordinate"
  }
}

Comandos que fazem o mesmo

DIMORDINATE

Esquema completo

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

Parâmetros (entrada)
JSON
{
  "$defs": {
    "Datum": {
      "oneOf": [
        {
          "const": "x",
          "type": "string"
        },
        {
          "const": "y",
          "type": "string"
        }
      ]
    }
  },
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "additionalProperties": false,
  "properties": {
    "datum": {
      "anyOf": [
        {
          "$ref": "#/$defs/Datum"
        },
        {
          "type": "null"
        }
      ],
      "description": "The ordinate coordinate: x or y."
    },
    "dim_text": {
      "default": null,
      "description": "The dimension text (<> is the measurement; without it, the measurement).",
      "maxLength": 10000,
      "type": [
        "string",
        "null"
      ]
    },
    "feature": {
      "description": "The dimensioned point [x, y].",
      "items": {
        "format": "double",
        "type": "number"
      },
      "maxItems": 2,
      "minItems": 2,
      "type": "array"
    },
    "leader_end": {
      "description": "The leader endpoint [x, y], where the text goes.",
      "items": {
        "format": "double",
        "type": "number"
      },
      "maxItems": 2,
      "minItems": 2,
      "type": "array"
    }
  },
  "required": [
    "feature",
    "leader_end"
  ],
  "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