Layout kit command

style.object.edit

Object Style Options

Changes an object style's name, base style, fill, stroke, paragraph style or text frame options, or redefines it from the selected object; the objects using it follow where they do not override it.

Kit
Layout 0.1.0 (.klayout)
Changes the document
yes

Parameters

Parameters of style.object.edit
NameTypeRequiredDescription
basedOnstring | nullnoan object style name; null for none
fillstring | nullnoa swatch name; null leaves the fill out of the style
fillTintnumberno0 to 1
fromSelectionbooleannoRedefine Style: the style takes the first selected object's fill, stroke and text frame options
namestringno
paragraphStylestring | nullnoa paragraph style name; null for none
renamestringnothe new name (every use follows)
strokestring | nullnoa swatch name; null leaves the stroke out of the style
strokeTintnumberno0 to 1
strokeWeightnumbernopoints
textFrameobject | nullno{columns, gutter, inset: [top, left, bottom, right], verticalJustification}; null leaves them out

Call through layout_run

text
layout_run {
  "path": "<file>.klayout",
  "steps": [{ "command": "style.object.edit" }]
}

The required parameters, with placeholders for their types: not a tested example. Optional: basedOn, fill, fillTint, fromSelection, name, paragraphStyle, rename, stroke, strokeTint, strokeWeight, textFrame. layout_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": {
    "basedOn": {
      "description": "an object style name; null for none",
      "type": [
        "string",
        "null"
      ],
      "x-khp-name": "objectName",
      "x-khp-types": [
        "Style"
      ]
    },
    "fill": {
      "description": "a swatch name; null leaves the fill out of the style",
      "type": [
        "string",
        "null"
      ],
      "x-khp-name": "name",
      "x-khp-types": [
        "Swatch"
      ]
    },
    "fillTint": {
      "description": "0 to 1",
      "type": "number"
    },
    "fromSelection": {
      "description": "Redefine Style: the style takes the first selected object's fill, stroke and text frame options",
      "type": "boolean"
    },
    "name": {
      "type": "string",
      "x-khp-name": "objectName",
      "x-khp-types": [
        "Style"
      ]
    },
    "paragraphStyle": {
      "description": "a paragraph style name; null for none",
      "type": [
        "string",
        "null"
      ],
      "x-khp-name": "paragraphName",
      "x-khp-types": [
        "Style"
      ]
    },
    "rename": {
      "description": "the new name (every use follows)",
      "type": "string"
    },
    "stroke": {
      "description": "a swatch name; null leaves the stroke out of the style",
      "type": [
        "string",
        "null"
      ],
      "x-khp-name": "name",
      "x-khp-types": [
        "Swatch"
      ]
    },
    "strokeTint": {
      "description": "0 to 1",
      "type": "number"
    },
    "strokeWeight": {
      "description": "points",
      "type": "number"
    },
    "textFrame": {
      "description": "{columns, gutter, inset: [top, left, bottom, right], verticalJustification}; null leaves them out",
      "type": [
        "object",
        "null"
      ]
    }
  },
  "type": "object"
}

Generated from the command list of @kition/[email protected] and the kit itself (layout_commands through @kition/[email protected], built from KitionAI/kition-layout@8767a18). As data: commands.jsonl.