CAD kit command
object.query
Query Entities
Answers a page of objects of one space (Model, or a layout by `layout`, without going there; default the space shown) filtered by type, layer and a crossing or inside window, with their handles, properties and geometry and the total count.
- Kit
- CAD 0.1.0 (.dxf)
- Changes the document
- no
Parameters
| Name | Type | Required | Description |
|---|---|---|---|
crossing | boolean | no | default true; false = entirely inside |
layer | string | no | a layer name |
layout | string | no | "Model" or a layout's name; default the space shown |
limit | integer | no | |
offset | number | no | |
type | string | no | |
window | number[][] | no |
Call through cad_run
text
cad_run {
"path": "<file>.dxf",
"steps": [{ "command": "object.query" }]
}The required parameters, with placeholders for their types: not a tested example. Optional: crossing, layer, layout, limit, offset, type, window. cad_run answers the step’s result in completed[i].result.
Result
| Name | Type | Required | Description |
|---|---|---|---|
count | number | no | |
entities | object[] | no | |
offset | number | no | |
returned | number | no |
Result JSON Schema
json
{
"additionalProperties": true,
"properties": {
"count": {
"type": "number"
},
"entities": {
"items": {
"additionalProperties": true,
"properties": {
"color": {
"type": "string"
},
"geometry": {
"additionalProperties": true,
"type": "object"
},
"handle": {
"type": "string"
},
"layer": {
"type": "string"
},
"transparency": {
"type": "string"
},
"type": {
"type": "string"
}
},
"type": "object"
},
"type": "array"
},
"offset": {
"type": "number"
},
"returned": {
"type": "number"
}
},
"type": "object"
}Parameter schema
json
{
"additionalProperties": false,
"properties": {
"crossing": {
"description": "default true; false = entirely inside",
"type": "boolean"
},
"layer": {
"description": "a layer name",
"type": "string"
},
"layout": {
"description": "\"Model\" or a layout's name; default the space shown",
"type": "string"
},
"limit": {
"type": "integer"
},
"offset": {
"type": "number"
},
"type": {
"type": "string"
},
"window": {
"items": {
"items": {
"type": "number"
},
"type": "array"
},
"type": "array"
}
},
"returns": "{count (all matches), returned, offset, entities}",
"type": "object"
}Generated from the command list of @kition/[email protected] and the kit itself (cad_commands through @kition/[email protected], built from KitionAI/kition-cad@1ec542d). As data: commands.jsonl.