CAD kit command

calculator.open

QuickCalc

Evaluates an arithmetic expression, with optional named variables, as QuickCalc does, and answers the result.

Kit
CAD 0.1.0 (.dxf)
Changes the document
no

Parameters

Parameters of calculator.open
NameTypeRequiredDescription
exprstringnolike (3+4)*2^2
varsobjectno

Call through cad_run

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

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

Result

Result of calculator.open
NameTypeRequiredDescription
messagestringno
valuenumberno
Result JSON Schema
json
{
  "additionalProperties": true,
  "properties": {
    "message": {
      "type": "string"
    },
    "value": {
      "type": "number"
    }
  },
  "type": "object"
}

Parameter schema

json
{
  "additionalProperties": false,
  "properties": {
    "expr": {
      "description": "like (3+4)*2^2",
      "type": "string"
    },
    "vars": {
      "additionalProperties": true,
      "properties": {
        "x": {
          "default": 1,
          "type": "integer"
        }
      },
      "type": "object"
    }
  },
  "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.