CAD kit command

select.similar

Select Similar

Selects every object shown in the space being edited that has the type and the layer of one of the selected objects (Select Similar: a line on Walls selects every line on Walls). It changes only the selection, which it needs: select one or more examples first. Answers how many objects are selected and their handles.

Kit
CAD 0.1.0 (.dxf)
Changes the document
no

Parameters

None.

Call through cad_run

text
cad_run {
  "path": "<file>.dxf",
  "steps": [{ "command": "select.similar" }]
}

The required parameters, with placeholders for their types: not a tested example. cad_run answers the step’s result in completed[i].result.

Result

Result of select.similar
NameTypeRequiredDescription
handlesstring[]nothe selected objects' handles
selectednumbernohow many objects are selected
Result JSON Schema
json
{
  "additionalProperties": true,
  "properties": {
    "handles": {
      "description": "the selected objects' handles",
      "items": {
        "type": "string"
      },
      "type": "array"
    },
    "selected": {
      "description": "how many objects are selected",
      "type": "number"
    }
  },
  "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.