query_drawing
Search CAD drawing entities by layer, kind, text, bounding box, or IDs, returning matching items, lengths, counts, and totals with pagination for targeted review and editing.
Instructions
List entities matching all given conditions, with IDs, layers, kinds, texts and lengths, plus totals (count, length and area, also in real mm). Uses 1 call.
layer / kind: one name or a list (kinds: LINE, ARC, CIRCLE, LWPOLYLINE, TEXT, MTEXT, INSERT, DIMENSION, HATCH...). text: a substring of the entity text (text_regex=true for a regular expression). bbox: [xmin, ymin, xmax, ymax] in drawing coordinates; bbox_mode "intersects" (default) or "within". ids: entity IDs. include_entities: also return each entity in IR form (use it as a model for edit_drawing's add). limit: 1-500 (default 50); pass next_cursor back as cursor for the next page. Narrow by layer or bbox first.
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"path": "<path>"
},
"name": "query_drawing"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| ids | No | ||
| bbox | No | ||
| kind | No | ||
| path | Yes | ||
| text | No | ||
| layer | No | ||
| limit | No | ||
| cursor | No | ||
| bbox_mode | No | ||
| use_edits | No | ||
| text_regex | No | ||
| include_entities | No |