Operaciones de BadBit CAD
cad.annotate.dim_baseline
Cotas de línea base (DIMBASELINE) a partir de una cota.
- Programa: BadBit CAD
- Tipo de acción: Cambia el dibujo
- Modifica el dibujo
- Desde la versión 2027.0.0-beta.8
A partir de la cota from_dimension, crea una cota por cada punto de next_origins, todas del mismo origen y separadas por el espaciado del estilo (DIMDLI), como DIMBASELINE; near elige el origen común. Devuelve los identificadores y los textos. Con objetos del papel, las coordenadas y las medidas son en mm (los objetos del modelo y del papel en la misma petición se rechazan); los ángulos y los factores de escala no cambian.
Parámetros
| Nombre | Tipo | Obligatorio | Descripción |
|---|---|---|---|
from_dimension | string | Sí | La cota de partida (lineal, alineada, angular o por coordenadas). |
near | array<number> | null | No | Un punto [x, y] cerca de la parte que cuenta (en la cota, cerca de la línea de referencia de donde sale la serie). |
next_origins | array<array<number>> | Sí | Los orígenes siguientes [[x, y], …]: una cota por cada uno. |
Errores
| Código | JSON-RPC | Qué significa |
|---|---|---|
invalid_params | -32602 | Los parámetros no siguen el esquema o una regla de la operación. |
not_found | -32001 | El objeto, la operación, el archivo o el nombre no existe. |
conflict | -32004 | El estado actual no lo permite ahora. |
failed | -32005 | La operación falló. |
Ejemplo
MCP
JSON
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"arguments": {
"from_dimension": "0190f3a2b4c5d6e7f8091a2b3c4d5e6f",
"next_origins": [
[
20,
0
],
[
30,
0
]
]
},
"operation": "cad.annotate.dim_baseline"
},
"name": "badbit_call_operation"
}
}Python
Python
import badbit
result = badbit.cad.annotate.dim_baseline(from_dimension="0190f3a2b4c5d6e7f8091a2b3c4d5e6f", next_origins=[[20, 0], [30, 0]])LISP
LISP
(badbit-call "cad.annotate.dim_baseline" '(("from_dimension" . "0190f3a2b4c5d6e7f8091a2b3c4d5e6f") ("next_origins" . ((20 0) (30 0)))))JSON-RPC
JSON
{
"id": 1,
"jsonrpc": "2.0",
"method": "badbit/call",
"params": {
"arguments": {
"from_dimension": "0190f3a2b4c5d6e7f8091a2b3c4d5e6f",
"next_origins": [
[
20,
0
],
[
30,
0
]
]
},
"operation": "cad.annotate.dim_baseline"
}
}Comandos que hacen lo mismo
Esquema completo
JSON Schema 2020-12, con las descripciones en inglés.
Parámetros (entrada)
JSON
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"additionalProperties": false,
"properties": {
"from_dimension": {
"description": "The starting dimension (linear, aligned, angular or ordinate).",
"type": "string"
},
"near": {
"default": null,
"description": "A point [x, y] near the part that counts (on a dimension, near the extension line the series starts from).",
"items": {
"format": "double",
"type": "number"
},
"maxItems": 2,
"minItems": 2,
"type": [
"array",
"null"
]
},
"next_origins": {
"description": "The next origins [[x, y], …]: one dimension for each.",
"items": {
"items": {
"format": "double",
"type": "number"
},
"maxItems": 2,
"minItems": 2,
"type": "array"
},
"maxItems": 10000,
"minItems": 1,
"type": "array"
}
},
"required": [
"from_dimension",
"next_origins"
],
"type": "object"
}Resultado (salida)
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"
}