Repository navigation
autonumbering
QElectroTech can number elements, conductors and sheets for you. There are three independent numbering systems, plus terminal numbering, which is a fourth thing entirely and works differently.
| System | Numbers | Set in |
|---|---|---|
| Element | element labels (K1, Q55) |
Project properties β element auto-numbering |
| Conductor | conductor texts (wire numbers) | Project properties β conductor auto-numbering |
| Sheet | the sheet field's %autonum
|
Project properties β sheet auto-numbering |
| Terminal | terminal strip numbering | its own dialog β see Β§8 |
Each project can hold several named schemes per system, and each sheet chooses which scheme it uses. That is how one project can number power wiring one way and control wiring another.
Source: sources/autoNum/ β numerotationcontext.cpp,
numerotationcontextcommands.cpp, assignvariables.cpp, and ui/ for the
editors; sources/conductorautonumerotation.cpp for conductors.
A numbering scheme (a numerotation context in the code) is a list of parts
joined together in order. K + a unit counter gives K1, K2, K3. Sheet
number + - + a counter gives 3-1, 3-2.
Each part has a type, and sixteen types exist:
These hold a number and advance. Seven types:
| Type | Padding | Notes |
|---|---|---|
unit |
none | plain counter: 1, 2, 3 |
ten |
to 2 digits | 01, 02 β¦ 10, 11 |
hundred |
to 3 digits | 001, 002 β¦ 010 β¦ 100 |
unitfolio |
none | as unit, but restarts on each sheet |
tenfolio |
to 2 digits | as ten, per sheet |
hundredfolio |
to 3 digits | as hundred, per sheet |
wrap |
none | wraps back to 0 every modulus values |
The folio variants are the useful ones for drawings where numbering should
restart per page rather than run through the whole project.
These take their value from where the element is, not from a counter:
| Type | Becomes |
|---|---|
idfolio |
the sheet index (%id) |
folio |
the sheet field (%F) |
plant |
the sheet's installation (%M) |
locmach |
the sheet's location/machine (%LM) |
elementline |
the element's row letter (%l) |
elementcolumn |
the element's column number (%c) |
elementprefix |
the element's prefix |
| Type | Becomes |
|---|---|
string |
fixed text you type β the K in K1
|
alpha |
a letter that advances a, b β¦ z, aa, ab β¦ |
alpha increments like a spreadsheet column name: base-26, carrying
right-to-left on z, and prepending a new leading letter when the whole string
overflows. It preserves the case of each position, so a scheme starting at A
runs A, B β¦ Z, aA β the prepended letter is always lowercase.
Beyond its type, a counter part carries four settings:
| Setting | Meaning |
|---|---|
| Value | the current value β what the next thing numbered will get |
| Increase | the step, normally 1 |
| Initial value | what the part resets to |
| Modulus | for wrap only: wrap back to 0 every N values |
| Format | zero-padding mask, spreadsheet style: 00 pads to two digits, 000 to three |
Format overrides the type's natural padding. ten pads to two digits on its
own; giving it a format of 0000 makes it four. An empty format keeps the
type's own width, which is also what every scheme written before the format
field existed does β so old projects are unaffected.
A scheme does not produce the label by itself. It supplies sequences, and a formula decides where they go.
The formula is ordinary label text with %sequ_1, %seqt_1, %seqhf_2 and
friends in it β see Variables & formulas for the full list.
The _1, _2 suffix picks which of the scheme's parts of that family to use,
in the order they are defined.
So a scheme with one string part (K) and one unit part, with formula
K%sequ_1, produces K1, K2, K3. Changing the formula to
%f-K%sequ_1 produces 3-K1 on sheet 3, without touching the scheme.
A sequence variable whose index the scheme does not define is left in the text
verbatim. A label reading %sequ_2 means the scheme has only one unit part β
it is not a numbering failure, and nothing warns you.
Elements are numbered when placed, if the sheet has an element scheme selected and new elements are not frozen.
Conductors are more involved, because a wire number belongs to a potential β every conductor electrically joined together β not to one conductor:
- Drawing a conductor onto an existing potential makes it inherit that potential's number rather than taking a new one.
- If the conductors already in that potential disagree β different texts or different formulas β QET cannot guess, and opens the potential selector so you choose which numbering the joined potential should take.
- Only a genuinely new potential draws a fresh number from the scheme.
That is why adding one wire sometimes renumbers nothing, and sometimes asks a question.
A related subtlety worth knowing: sheet variables in a conductor formula resolve per conductor, not per potential. A potential spanning two sheets therefore does not get one sheet number for the whole potential β each conductor resolves against the sheet it is drawn on.
Freezing stops numbers changing when the drawing does. There are three levels, and they are easy to confuse:
| Scope | What it does |
|---|---|
| Project β freeze new elements / new conductors | newly placed items are created with their label frozen |
Sheet β freezeNewElement, freezeNewConductor
|
the same, per sheet |
| Item β freeze label | this one element or conductor keeps its current text |
A frozen label is no longer recomputed. Insert a sheet ahead of it, and a frozen
3-K1 stays 3-K1 while its unfrozen neighbours become 4-K1. That is the
point of the feature β an issued drawing should not renumber itself β but it is
also why a project can end up with numbers that disagree with their own formula.
Sheet numbering is the odd one out: it feeds a single variable, %autonum,
which is only meaningful in the sheet field. Set the sheet field to
%autonum (instead of the default %id/%total) and the sheet scheme decides
what appears.
Note the consequence: %f, %l, %c and %{β¦} do nothing in the sheet
field β it understands only %autonum, %id and %total. See
Variables & formulas Β§6.
Schemes live in the project's default properties:
<conductors_autonums current_autonum="control" freeze_new_conductors="false"
auto_break_conductors="false">
<conductor_autonum title="control" formula="%sequ_1">
<part type="unit" value="1" increase="1"/>
</conductor_autonum>
</conductors_autonums>
<folio_autonums>
<folio_autonum title="pages"> ... </folio_autonum>
</folio_autonums>
<element_autonums current_autonum="default" freeze_new_elements="false">
<element_autonum title="default" formula="%sequ_1"> ... </element_autonum>
</element_autonums>Each <part> carries type, value and increase. Three more attributes are
written only when they apply: initialvalue for the three β¦folio counter
types, modulus for wrap, and format only when a padding mask was actually
set. An absent attribute therefore means "not applicable" or "default", not
zero.
current_autonum names the scheme in use. A scheme with an empty title or an
empty formula is not written at all β so a half-configured scheme silently
disappears on save.
Per sheet, <diagram> carries freezeNewElement and freezeNewConductor.
Numbering the terminals of a terminal strip is not part of this system. It
has its own dialog, and it respects a per-element flag: an element whose
information carries auto_num_locked = "true" is skipped rather than
renumbered.
That flag is compared against the exact string "true" β see
Linking elements Β§6. Terminal strips themselves are
covered in Terminal strips.
-
An undefined sequence variable prints itself.
%sequ_2on a drawing means the scheme defines one unit part, not two. - A scheme with no title or no formula is dropped on save. It will be gone when you reopen, with no message.
- Freezing is remembered per item, so a project can contain labels that no longer match their formula, on purpose.
- A new conductor usually does not get a new number β it inherits the potential's. If you expected a fresh number, check whether the wire is electrically joined to something already numbered.
-
Format overrides type padding, so
tenwith format0produces unpadded numbers despite its name.
See also: Variables & formulas Β· Linking elements Β· Terminal strips Β· Project XML
Getting Started
π Languages β English Β· FranΓ§ais Β· Deutsch
Windows without admin rights β the portable archive, no installer
Guides
Conductors β wire properties, what feeds which export, cables, and hops where wires cross
Wires per terminal β limit the wires on a terminal, chain wiring instead of stars
Printing and exporting β paper, PDF, images, and what each path does differently
Linking elements β master, slave, terminal
PLC modules β I/O tables and linking a wire to a specific point
Using the element editor β drawing tools, saving, checks
Generic devices β a quick box symbol with terminals on any side, made by a wizard (pending)
Grid size and element size β why symbols aren't all the same scale, and scaling one without leaving the grid
Preferences reference β what each settings page does
Saving and loading settings β your whole setup in one file, to copy or keep
Keyboard-only control β mouseless QET, and what still needs a mouse
Mouse modifiers β what Shift, Ctrl and Alt change while you drag
3D mouse β SpaceMouse pan, zoom and buttons
Aligning items β snap symbols back to the grid, or line them up
Pictures on a sheet β labels, crop, transparency, what they cost in the file
Arcs and curved wires β the Arc tool, pulling an arc in or out, rounding a corner with a fillet, dashed arcs for lighting layouts
Grouping items β select, move and copy several items as one
Finding your place on a sheet β go to a cell like B13 or 4-B7, keep the headers in sight, show the cell limits, zoom and pan
Showing and hiding kinds of items β hide texts, wire numbers, shapes, pictures, tables or cross-references on every sheet
Drawing faster β place without dragging, the S shortcut bar, command search, gestures
Customising QElectroTech β keys, toolbar size and contents, the gesture ring (partly pending)
Managing collections β folders, writability, building your own shortlist
Templates β reusable multi-element blocks, placed by double-click or drag
Search & Replace β bulk property changes
Building a nomenclature query β the BOM/summary table builder
Linking wires across pages β sheet reports
Variables & formulas β %f, %{label}, sequences
Auto-numbering β schemes, sequences, freezing
Terminal strips β strips, levels, bridges
Title block templates β the .titleblock format
Importing EPLAN parts (.edz) β EPLAN Data Portal
DXF import & export β two unrelated features, one format; command-line export and layers
The project database β the in-memory SQLite cache
Development
Automating QET β CLI, XML formats, external tools
CLI Reference β command line usage
JavaScript Scripting β --run, geometry editing, undo
MCP server β let an AI assistant read, verify and edit projects
Connecting an AI assistant β setup for Claude, Copilot, Gemini, Codex, Cursor, LM Studio
Script buttons β stored scripts with an icon, by hand or by an assistant
Live mode β an assistant working in the open project while you watch
Macro recorder β record a task by hand, for an assistant to script
Vision β proposal, under discussion
