Vector kit command

graphicStyle.addFromLibrary

Add to Graphic Styles

Adds graphic styles from a library to the document, optionally applying the first to the selection.

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

Parameters

Parameters of graphicStyle.addFromLibrary
NameTypeRequiredDescription
addbooleannowith apply: add its appearance on top, as Alt-click
applybooleannoalso apply the first one to `ids` or the selection, if any, as graphicStyle.apply
contentsanynowith apply, as graphicStyle.apply; one of several alternative parameters
idintegernoobject ID
idsinteger[]noobject IDs
librarystringno
nameany[]no[style names in the library] (default: all of it); default: all of it; one of several alternative parameters
namesany[]no[style names in the library] (default: all of it); default: all of it; one of several alternative parameters
targetstringnolike object; one of several alternative parameters

Call through vector_run

text
vector_run {
  "path": "<file>.kvector",
  "steps": [{ "command": "graphicStyle.addFromLibrary" }]
}

The required parameters, with placeholders for their types: not a tested example. Optional: add, apply, contents, id, ids, library, name, names, target. vector_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": {
    "add": {
      "default": false,
      "description": "with apply: add its appearance on top, as Alt-click",
      "type": "boolean"
    },
    "apply": {
      "default": false,
      "description": "also apply the first one to `ids` or the selection, if any, as graphicStyle.apply",
      "type": "boolean"
    },
    "contents": {
      "description": "with apply, as graphicStyle.apply; one of several alternative parameters"
    },
    "id": {
      "description": "object ID",
      "type": "integer",
      "x-khp-types": [
        "Node"
      ]
    },
    "ids": {
      "description": "object IDs",
      "items": {
        "type": "integer"
      },
      "type": "array",
      "x-khp-types": [
        "Node"
      ]
    },
    "library": {
      "type": "string"
    },
    "name": {
      "description": "[style names in the library] (default: all of it); default: all of it; one of several alternative parameters",
      "items": {},
      "type": "array",
      "x-khp-name": "name",
      "x-khp-types": [
        "GraphicStyle"
      ]
    },
    "names": {
      "description": "[style names in the library] (default: all of it); default: all of it; one of several alternative parameters",
      "items": {},
      "type": "array",
      "x-khp-name": "name",
      "x-khp-types": [
        "GraphicStyle"
      ]
    },
    "target": {
      "description": "like object; one of several alternative parameters",
      "type": "string"
    }
  },
  "returns": "{library, added: [names in the document], existing: [names already there], applied?: name}",
  "type": "object"
}

Generated from the command list of @kition/[email protected] and the kit itself (vector_commands through @kition/[email protected], built from KitionAI/kition-vector@7cf908f). As data: commands.jsonl.