---
title: "constraint.dimensionLinear: Linear — CAD kit command — Kition"
description: "Adds a horizontal or vertical distance constraint between two points, with a value or expression, and re-solves."
canonical: "https://developer.kition.ai/docs/kits/cad/commands/constraint.dimensionLinear"
---

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

# constraint.dimensionLinear

**Linear.** Adds a horizontal or vertical distance constraint between two points, with a value or expression, and re-solves.

- 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 |
| --- | --- | --- | --- |
| `expr` | `string` | no |  |
| `h1` | `string` | no |  |
| `h2` | `string` | no |  |
| `name` | `string` | no |  |
| `p1` | `string \| number[]` | no |  |
| `p2` | `string \| number[]` | no |  |
| `value` | `number` | no |  |

## Call through cad_run

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

The required parameters, with placeholders for their types: not a tested example. Optional: `expr`, `h1`, `h2`, `name`, `p1`, `p2`, `value`. 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": {
    "expr": {
      "type": "string"
    },
    "h1": {
      "type": "string",
      "x-khp-types": [
        "Entity"
      ]
    },
    "h2": {
      "type": "string",
      "x-khp-types": [
        "Entity"
      ]
    },
    "name": {
      "type": "string"
    },
    "p1": {
      "oneOf": [
        {
          "type": "string"
        },
        {
          "items": {
            "type": "number"
          },
          "type": "array"
        }
      ]
    },
    "p2": {
      "oneOf": [
        {
          "type": "string"
        },
        {
          "items": {
            "type": "number"
          },
          "type": "array"
        }
      ]
    },
    "value": {
      "type": "number"
    }
  },
  "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).
