Operaciones de BadBit CAD
cad.draw.xline
Dibuja líneas auxiliares (XLINE) por un punto.
- Programa: BadBit CAD
- Tipo de acción: Cambia el dibujo
- Modifica el dibujo
- Desde la versión 2027.0.0-beta.8
Crea una línea auxiliar infinita de base pasando por cada punto de through, como XLINE punto a punto. Devuelve los identificadores en orden. En el papel (una presentación a la vista, fuera de las ventanas gráficas), las coordenadas y las medidas son en mm; los ángulos y los factores de escala no cambian.
Parámetros
| Nombre | Tipo | Obligatorio | Descripción |
|---|---|---|---|
base | array<number> | Sí | El punto base [x, y] (en las preguntas a la persona, la línea elástica sale de él hasta el cursor). |
layer | string | null | No | Nombre de la capa. |
through | array<array<number>> | Sí | Los puntos [[x, y], …] por donde pasa cada línea. |
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": {
"base": [
0,
0
],
"through": [
[
10,
0
],
[
0,
10
]
]
},
"operation": "cad.draw.xline"
},
"name": "badbit_call_operation"
}
}Python
Python
import badbit
result = badbit.cad.draw.xline(base=[0, 0], through=[[10, 0], [0, 10]])LISP
LISP
(badbit-call "cad.draw.xline" '(("base" . (0 0)) ("through" . ((10 0) (0 10)))))JSON-RPC
JSON
{
"id": 1,
"jsonrpc": "2.0",
"method": "badbit/call",
"params": {
"arguments": {
"base": [
0,
0
],
"through": [
[
10,
0
],
[
0,
10
]
]
},
"operation": "cad.draw.xline"
}
}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": {
"base": {
"description": "The base point [x, y] (in prompts to the person, the rubber-band line runs from it to the cursor).",
"items": {
"format": "double",
"type": "number"
},
"maxItems": 2,
"minItems": 2,
"type": "array"
},
"layer": {
"default": null,
"description": "Layer name.",
"type": [
"string",
"null"
]
},
"through": {
"description": "The points [[x, y], …] each line passes through.",
"items": {
"items": {
"format": "double",
"type": "number"
},
"maxItems": 2,
"minItems": 2,
"type": "array"
},
"maxItems": 10000,
"minItems": 1,
"type": "array"
}
},
"required": [
"base",
"through"
],
"type": "object"
}Resultado (salida)
JSON
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"properties": {
"ids": {
"description": "Object identifiers (32 hexadecimal digits each).",
"items": {
"type": "string"
},
"type": "array"
}
},
"required": [
"ids"
],
"type": "object"
}