-
Notifications
You must be signed in to change notification settings - Fork 0
Property Calculation
Automatically calculates a custom property's value and writes it onto the elements that carry that property — for example, the full text of a group's label cell, the element's coordinates, or a fixed value. Property Calculation is a value engine: it only fills values in, it never attaches properties itself (attaching is Custom Properties' job — it writes only where the property is already attached). It reuses the shared ARES DGNLib custom properties (Item Types).
Each property's value comes from a calculation rule in ARES_Calc_Rules. A rule is:
Prop[name] [& condition]* = Source
-
Prop[name]— the target property (one name, no wildcards). ARES writes this property's value wherever it is attached. -
& condition(optional) — the same conditions as the attach rules:Lvl[level],Cell[name],Type[type], combined with&(AND), negated with!, with*/?wildcards (see Custom Properties). The rule applies only to elements matching every condition. -
= Source— where the value comes from. One of:
| Source | Value |
|---|---|
CellText[pattern] |
The full text of a cell of the element's graphic group whose name matches pattern (wildcards allowed; pattern may list several |-separated alternatives, e.g. ASUF*|SP0*). Includes the element itself — a label cell that carries the property gets its own text; an ungrouped matching cell also gets its own text. |
CellCoord[pattern] |
The "X;Y" coordinates of that same matching cell (same pattern grammar as CellText) — the TAGGING cell's own position, not the element's. Use this when a property must carry the position of the cell that grouped it, not its own. |
CellId[pattern] |
The ID of that same matching cell. |
Value[text] |
A fixed literal value (e.g. Value[Type-A]). |
Coord or Coord[n]
|
The element's OWN "X;Y" coordinates (n = number of decimals; default is ARES_Round). Recomputed when the element moves. |
Id |
The element's OWN ID. |
Several rules for the same property: the first that matches wins. Rules are tried in order, so put the specific rules before the general ones. Example:
Prop[Repere]&Cell[ETIREF]=Value[REF] ; Prop[Repere]=CellText[ETI*] ; Prop[XY]=Coord ; Prop[Coordonnee]=CellCoord[ASUF*|SP0*]
Here Repere is REF on the ETIREF cell (first rule wins), and the group's ETI* cell text elsewhere; XY is each element's own coordinates; Coordonnee is the position of whichever ASUF*/SP0* cell tagged the group. Separate rules with ;.
The engine reacts live: filling a property when it is attached, recomputing Coord/CellCoord when the relevant element moves, following a label cell's text when it is edited, and clearing a value when its source cell is deleted (or, with ARES_Calc_Detach_Empty on, detaching the property). CellId never needs to recompute after the initial fill — an element's ID cannot change.
The options dialog edits the calc rules one at a time, exactly like the Custom Properties attach-rule editor: an editable drop-down (pick a rule → edit → commit replaces it; free-type + commit appends; empty + commit removes it), with a coloured syntax preview below it (keywords in bold, & blue, ! orange, * / ? green, an impossible-condition combination shown in red). A malformed rule is refused (a status-bar message, nothing saved). Bulk edits still travel via .cfg import/export.
macro vba run [ARES]EditPropertyCalculationOptions
Opens the Property Calculation options (the master switch, the detach-empty option, and the calc-rules editor). Editing is write-through — the config stays in sync, no restart.
| Variable | Default | Purpose |
|---|---|---|
ARES_Property_Calc |
False | Master switch for the feature (off by default). |
ARES_Calc_Rules |
(empty) | The calculation rules: Prop[name][&conditions]=Source ; … (Source = CellText[pattern] / CellCoord[pattern] / CellId[pattern] / Value[text] / Coord[n] / Id; a pattern may be several |-separated alternatives). First matching rule per property wins. |
ARES_Calc_Detach_Empty |
False | When on, a property whose calculated value ends up empty is detached (the tagger removes it) instead of being kept empty; a rule that still mandates the property re-attaches it (empty). |
ARES Wiki
🇬🇧 English
- Home
- Auto Lengths
- Zoning
- Zone Export
- Region Split
- Custom Properties
- Property Calculation
- System & Config
- Configuration Variables
🇫🇷 Français