---
title: "file.purge: Purge — CAD kit command — Kition"
description: "Removes unused named items of one or every type (blocks, layers, styles and more) and zero-length or empty objects, matching names."
canonical: "https://developer.kition.ai/docs/kits/cad/commands/file.purge"
---

> Canonical HTML: [https://developer.kition.ai/docs/kits/cad/commands/file.purge](https://developer.kition.ai/docs/kits/cad/commands/file.purge)

# 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); reference: [CAD kit commands](https://developer.kition.ai/docs/kits/cad.md)
- Changes the document: yes

## Parameters

| Name | Type | Required | Description |
| --- | --- | --- | --- |
| `names` | `string` | no | like A*,B; default * |
| `type` | `"all" \| "blocks" \| "dimstyles" \| "groups" \| "layers" \| "linetypes" \| "mleaderstyles" \| "tablestyles" \| "textstyles" \| "zerolength" \| "emptytext"` | no | default 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/cad-darwin-arm64@0.1.0 and the kit itself (cad_commands through @kition/cli@0.1.1, built from KitionAI/kition-cad@1ec542d).
