CAD kit command

file.purge

Purge

Removes unused named items of one or every type (blocks, layers, styles and more) and zero-length or empty objects, matching names.

Kit
CAD 0.1.0 (.dxf)
Changes the document
yes

Parameters

Parameters of file.purge
NameTypeRequiredDescription
namesstringnolike A*,B; default *
type"all" | "blocks" | "dimstyles" | "groups" | "layers" | "linetypes" | "mleaderstyles" | "tablestyles" | "textstyles" | "zerolength" | "emptytext"nodefault all: every named type

Call through cad_run

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

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

Result

The kit gives no result schema for this command.

Parameter schema

json
{
  "additionalProperties": false,
  "properties": {
    "names": {
      "description": "like A*,B; default *",
      "type": "string"
    },
    "type": {
      "description": "default all: every named type",
      "enum": [
        "all",
        "blocks",
        "dimstyles",
        "groups",
        "layers",
        "linetypes",
        "mleaderstyles",
        "tablestyles",
        "textstyles",
        "zerolength",
        "emptytext"
      ],
      "type": "string"
    }
  },
  "returns": "purged",
  "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.