CAD kit command

object.setProperties

Set Properties

Sets properties of the given objects, or the selection: layer, colour, linetype, lineweight, scale, transparency, visibility and geometry fields.

Kit
CAD 0.1.0 (.dxf)
Changes the document
yes
Acts on
handles (a list of ids), which a run step’s on fills

Parameters

Parameters of object.setProperties
NameTypeRequiredDescription
anglenumbernodegrees; a line's, or a hatch pattern's
aperturenumbernoPick reach in drawing units; default 0.5% of the space extents.
areanumberno
centernumber[]no
circumferencenumberno
closedbooleanno
colorstringno
diameternumberno
dimStylestringnoa dimension style name
endnumber[]no
endAnglenumbernodegrees
handlesstring[]no
heightnumberno
layerstringnoa layer name
lengthnumbernoa line's
linetypestringno
lineweightnumber | stringno
ltscalenumberno
patternstringnoa hatch pattern name
picknumber[]noInstead of handles: a drawing-space point [x,y], picked by the engine in the call's layout. With basis, holds what was at that point.
positionnumber[]nowhere a text, a paragraph, a point or a block reference is placed
radiusnumberno
rotationnumbernodegrees
scalenumbernoa block's or hatch pattern's
startnumber[]no
startAnglenumbernodegrees
textstringno
textOverridestringnoa dimension's
transparencynumber | stringno
vertexnumbernoa polyline vertex, from 0, that vertexAt moves
vertexAtnumber[]no
visiblebooleanno
widthnumbernoa polyline's or text frame's
widthFactornumberno

Call through cad_run

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

The required parameters, with placeholders for their types: not a tested example. Optional: angle, aperture, area, center, circumference, closed, color, diameter, dimStyle, end, endAngle, handles, height, layer, length, linetype, lineweight, ltscale, pattern, pick, position, radius, rotation, scale, start, startAngle, text, textOverride, transparency, vertex, vertexAt, visible, width, widthFactor. 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": {
    "angle": {
      "description": "degrees; a line's, or a hatch pattern's",
      "type": "number"
    },
    "aperture": {
      "description": "Pick reach in drawing units; default 0.5% of the space extents.",
      "type": "number"
    },
    "area": {
      "type": "number"
    },
    "center": {
      "items": {
        "type": "number"
      },
      "type": "array"
    },
    "circumference": {
      "type": "number"
    },
    "closed": {
      "type": "boolean"
    },
    "color": {
      "type": "string"
    },
    "diameter": {
      "type": "number"
    },
    "dimStyle": {
      "description": "a dimension style name",
      "type": "string",
      "x-khp-name": "name",
      "x-khp-types": [
        "DimStyle"
      ]
    },
    "end": {
      "items": {
        "type": "number"
      },
      "type": "array"
    },
    "endAngle": {
      "description": "degrees",
      "type": "number"
    },
    "handles": {
      "items": {
        "type": "string"
      },
      "type": "array",
      "x-khp-types": [
        "Entity"
      ]
    },
    "height": {
      "type": "number"
    },
    "layer": {
      "description": "a layer name",
      "type": "string",
      "x-khp-name": "name",
      "x-khp-types": [
        "Layer"
      ]
    },
    "length": {
      "description": "a line's",
      "type": "number"
    },
    "linetype": {
      "type": "string",
      "x-khp-name": "name",
      "x-khp-types": [
        "Linetype"
      ]
    },
    "lineweight": {
      "oneOf": [
        {
          "type": "number"
        },
        {
          "type": "string"
        }
      ]
    },
    "ltscale": {
      "type": "number"
    },
    "pattern": {
      "description": "a hatch pattern name",
      "type": "string"
    },
    "pick": {
      "description": "Instead of handles: a drawing-space point [x,y], picked by the engine in the call's layout. With basis, holds what was at that point.",
      "items": {
        "type": "number"
      },
      "type": "array"
    },
    "position": {
      "description": "where a text, a paragraph, a point or a block reference is placed",
      "items": {
        "type": "number"
      },
      "type": "array"
    },
    "radius": {
      "type": "number"
    },
    "rotation": {
      "description": "degrees",
      "type": "number"
    },
    "scale": {
      "description": "a block's or hatch pattern's",
      "type": "number"
    },
    "start": {
      "items": {
        "type": "number"
      },
      "type": "array"
    },
    "startAngle": {
      "description": "degrees",
      "type": "number"
    },
    "text": {
      "type": "string"
    },
    "textOverride": {
      "description": "a dimension's",
      "type": "string"
    },
    "transparency": {
      "oneOf": [
        {
          "type": "number"
        },
        {
          "type": "string"
        }
      ]
    },
    "vertex": {
      "description": "a polyline vertex, from 0, that vertexAt moves",
      "type": "number"
    },
    "vertexAt": {
      "items": {
        "type": "number"
      },
      "type": "array"
    },
    "visible": {
      "type": "boolean"
    },
    "width": {
      "description": "a polyline's or text frame's",
      "type": "number"
    },
    "widthFactor": {
      "type": "number"
    }
  },
  "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.