get_reference_card
Reference card of the uniwire format
Return the reference card of the uniwire format for electrical diagrams: document skeleton, node types
(breakers, RCDs, cables, loads, transformers, PV...) and their fields, enums, links, pitfalls, examples.
Read it once before writing a document; type_info gives the fields of one type in detail.
输入参数langlevel
list_types
List the node types
List the node types of the format (type, category, label), optionally for one category. Use it to
find the type name of a device or load before writing a node; type_info then gives its fields.
输入参数langcategory
type_info
Fields of a node type
Return every field of one node type with its description, unit and allowed values (enums). Use it
before writing or editing a node of that type; list_types gives the type names.
输入参数langtype必填
validate
Validate an electrical diagram
Validate a uniwire document (electrical diagram as JSON) against the format only: structure, types,
ids, references and links, without the electrical rules (use check for those). Returns valid + issues,
each naming the node id and field when possible, plus viewer_url (the document in the uniwire web
editor) and pdf_url (the PDF drawn by uniwire).
输入参数document必填
check
Check an electrical installation (NF C 15-100, IEC 60364)
Check an electrical installation (single-line diagram, panel, schéma unifilaire, tableau électrique):
validates the document, then applies the rule profiles (NF C 15-100 'nfc15100', French grid connection 'enedis',
IEC 60364 'iec60364', PLC;
default: the document's 'profiles'; 'core' always applies): breaker ratings against cable sections, RCDs,
circuits per protection, selectivity...
Returns findings (level error/warning/info, rule, node id, message, source), a summary, 'scope' (what the
checks cover and do not cover: automatic checks of the document data, not a conformity certificate),
viewer_url (the document in the uniwire web editor: drawing, findings, downloads) and pdf_url (the PDF
drawn by uniwire).
输入参数document必填profiles
describe
Outline of an electrical diagram
Return a text outline of an electrical diagram: installation, full tree of the panel with stable ids,
ratings and cables, links, interlocks, boards and findings summary. Use it to read a document and find
the node ids before apply_patch.
输入参数langdocument必填
apply_patch
Edit an electrical diagram
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).
输入参数ops必填document必填validate
render
Draw the single-line or multi-line diagram
Draw the electrical diagram (schéma unifilaire / multifilaire). kind: 'single-line' or 'multi-line';
view: a view id of the document (e.g. a
wire-marking view). format 'svg' returns the SVG text of every sheet (or of 'sheet', numbered from 1);
'pdf' writes to 'path' if given, else returns base64 (requires the uniwire[pdf] extra); on the hosted
server it returns pdf_url (the PDF drawn by uniwire) instead.
color: 'none' | 'conductors' | 'phase' | 'source' | 'status' | 'voltage' (adds a legend);
conductor_colors: 'iec' (IEC 60445) | 'us'.
输入参数kindpathviewcolorsheetformatdocument必填conductor_colors
viewer_link
Links to open the diagram and its PDF
Links to a document: viewer_url opens it in the uniwire web editor (drawing, single-line and
multi-line, rule findings, PDF and SVG downloads, nothing to install); pdf_url is the PDF drawn by
uniwire. On the hosted server the document is kept 30 days so that the short links open it
(anyone with a link can open it); elsewhere it travels in the link (after '#') and is stored nowhere.
输入参数document必填
wiring
Wire list, wire markers and cable schedule
Wiring exports of an installation as rows with stable column names (repérage des fils, carnet de
câbles): what='markers' (one row per wire end, for label
printers), 'wires' (wire list) or 'cables' (cable schedule). Marks follow the wire_marking rules of
the view (id), by default the first view that declares them.
输入参数viewwhatdocument必填
Compute the bill of materials (nomenclature) of an electrical installation from its document: one row
per manufacturer / part number for the nodes with a product reference, then one row per kind of
equipment without a reference (type and main characteristics in 'spec', e.g. 'C16 1P+N') and per kind of
cable (total length in 'length_m'), with quantities and the reference designations involved. Use it to
prepare a quote or an order; wiring gives the wire list and cable schedule.
输入参数document必填
list_examples
List the example installations
List the 53 example installations (dwellings, shops, offices, workshops, PV, EV charging, UPS, MV/LV
substations, PLCs): name, title, language, profiles, earthing, system.
无需输入参数。
get_example
Get an example installation
Return an example installation document by name. Use it as a starting point for a similar
installation, then edit it with apply_patch; list_examples gives the names.
输入参数name必填
normalize
Normalized document
Return the resolved form of a document: templates ('use') applied, every node and link id assigned,
numbers in canonical form. Use it to read a document exactly as the rules and drawings see it, or to get
stable ids before apply_patch; it does not apply the electrical rules (see check).
输入参数document必填