---
title: "drafting.objectSnap: Object Snap — CAD kit command — Kition"
description: "Turns running object snaps on or off and sets their modes by name or OSMODE bits; answers the state and the active modes."
canonical: "https://developer.kition.ai/docs/kits/cad/commands/drafting.objectSnap"
---

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

# drafting.objectSnap

**Object Snap.** Turns running object snaps on or off and sets their modes by name or OSMODE bits; answers the state and the active modes.

- Kit: CAD 0.1.0 (.dxf); reference: [CAD kit commands](https://developer.kition.ai/docs/kits/cad.md)
- Changes the document: no

## Parameters

| Name | Type | Required | Description |
| --- | --- | --- | --- |
| `modes` | `string[]` | no |  |
| `on` | `boolean` | no |  |
| `osmode` | `integer` | no | instead of modes |

## Call through cad_run

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

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

## Result

| Name | Type | Required | Description |
| --- | --- | --- | --- |
| `message` | `string` | no |  |
| `modes` | `string[]` | no |  |
| `on` | `boolean` | no |  |
| `osmode` | `number` | no |  |

```json
{
  "additionalProperties": true,
  "properties": {
    "message": {
      "type": "string"
    },
    "modes": {
      "items": {
        "type": "string"
      },
      "type": "array"
    },
    "on": {
      "type": "boolean"
    },
    "osmode": {
      "type": "number"
    }
  },
  "type": "object"
}
```

## Parameter schema

```json
{
  "additionalProperties": false,
  "properties": {
    "modes": {
      "items": {
        "type": "string"
      },
      "type": "array"
    },
    "on": {
      "type": "boolean"
    },
    "osmode": {
      "description": "instead of modes",
      "type": "integer"
    }
  },
  "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).
