Design kit command

object.batchRename

Batch rename

Renames several layers at once by find and replace (optionally regex) or a pattern with numbering codes.

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

Parameters

Parameters of object.batchRename
NameTypeRequiredDescription
findstringno
ids(integer | string)[]no
namestringnopattern for the whole name
regexbooleanno
replacestringno
startnumbernowhere $n starts and $N stops; default 1

Call through design_run

text
design_run {
  "path": "<file>.kdesign",
  "steps": [{ "command": "object.batchRename" }]
}

The required parameters, with placeholders for their types: not a tested example. Optional: find, ids, name, regex, replace, start. design_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": {
    "find": {
      "type": "string"
    },
    "ids": {
      "items": {
        "description": "an id",
        "oneOf": [
          {
            "type": "integer"
          },
          {
            "type": "string"
          }
        ]
      },
      "type": "array",
      "x-khp-types": [
        "Node"
      ]
    },
    "name": {
      "description": "pattern for the whole name",
      "type": "string"
    },
    "regex": {
      "type": "boolean"
    },
    "replace": {
      "type": "string"
    },
    "start": {
      "description": "where $n starts and $N stops; default 1",
      "type": "number"
    }
  },
  "type": "object"
}

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