Edit an electrical diagram
apply_patchEdit electrical diagrams by node ID to change ratings, add circuits, move loads, rename nodes, or link controls. Returns the updated document or names the failing operation.
Instructions
Edit an electrical diagram by node id (change a rating, add a circuit, move a load...) and return the new document. ops (applied in order): {"op":"set","id":ID,"path":"in_A","value":20} (null value removes; no id = document root, e.g. path "installation.earthing"); {"op":"add","parent":ID,"node":{...},"index":0} (or "at":"sources"); {"op":"remove","id":ID}; {"op":"move","id":ID,"parent":ID,"index":0}; {"op":"rename","id":ID,"new_id":NEW}; {"op":"link","link":{"kind":"control","from":ID,"to":ID}}; {"op":"unlink","id":LINK_ID} or {"op":"unlink","from":ID,"to":ID,"kind":K}. On failure returns ok=false and errors naming the failing op index (null = validation of the result).
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| ops | Yes | The edit operations, applied in order (list, or its JSON text): see the description for the operation forms. | |
| document | Yes | The uniwire document of the electrical installation: a JSON object, or its JSON text, as returned by get_example, apply_patch or normalize (a file path is accepted when the server runs locally). | |
| validate | No | Validate the resulting document (default true). |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||