Short description
Purpose: Increment or decrement numeric values inside TEXT, MTEXT, ATTDEF, and ATTRIB strings using a dialog-driven plus/minus value and target position Scope: Works on selected text-based entities, parsing each string to find embedded numbers, then modifies one or more of those numbers according to user settings Persistence: Stores last used increment value and location in the Windows registry under HKCUSoftwarePlusMinusNumericValue for reuse across sessions
Command:
Command: PlusMinusNumericValue (sometimes documented as INV3) How to run: Type PlusMinusNumericValue in the command line and press Enter Dialog: “Plus / Minus” dialog with two edit boxes: • Plus or Minus value — amount to add or subtract (supports integer or real) • Location [1..n] — which numeric block(s) to change: number index, “All”, or left empty for default 1 Selection: After dialog, selects TEXT, MTEXT, ATTRIB, ATTDEF entities with ssget filter
Description:
The routine opens a compact dialog where you enter a numeric increment/decrement value and specify which numeric segment(s) in the text to modify (by position, All, or via a later List prompt). It then scans the selected annotation objects, breaks each string into alternating numeric and non-numeric chunks, and applies the requested numeric adjustment to the chosen chunk(s) only, leaving surrounding text intact. For attributes, you can choose whether to modify the Tag or the Text string; for MTEXT, it respects basic control codes so numbers are not broken by formatting sequences. All changes are grouped in a single UNDO mark and the last-used dialog values are remembered via registry for the next run.
Helper function: (if any)
• _endUndo — Ends the active UNDO mark safely when the command completes or errors • _unloadDCL — Unloads the temporary DCL dialog resource if it is loaded • Custom *error* — Restores the previous *error*, prints messages for real errors, unloads the DCL, ends UNDO, and exits cleanly • PlusMinusNumericValue-Get / -Set — Read and write registry values under HKEY_CURRENT_USERSoftwarePlusMinusNumericValue for AddValue and LocValue • PlusMinusNumericValue-WriteDCL — Creates a temporary DCL file in the temp folder defining the “Plus / Minus” dialog with value and location fields and OK/Cancel buttons • PlusMinusNumericValue-ShowDCL — Loads the DCL, initializes tiles from registry or global defaults, handles OK/Cancel actions, updates registry and globals, and returns (value location) or nil • isPositionNumber — Tests whether a character at a given position is part of a number (digit, decimal point, optional leading minus when allowed) • parseString — Splits a string into a list of numeric and non-numeric substrings, with special handling for MTEXT control codes so they are kept as single tokens • adjustString — Core numeric modifier: chooses which numeric segments to change (by index, All, or interactive List), modifies them as integer or real, and rebuilds the final string while returning updated location default • myItoa — Helper inside adjustString that adjusts integer-like numbers while preserving leading zeros and sign where appropriate
Functionalities:
• Dialog-driven numeric change — User sets plus/minus value and which numeric position(s) to affect before any entity is touched • Integer and real support — Detects whether the input increment contains a decimal point and handles values as REAL when needed, preserving or extending decimal places • Location modes — Supports changing a specific numeric block by index, all numeric blocks at once, or using interactive List mode to review positions before deciding • MTEXT-aware parsing — Respects MTEXT control sequences (like C, H, etc.), treating them as units so formatting is preserved around changed numbers • Attribute mode choice — For ATTDEF objects, prompts once whether to modify Tag or Text, then applies this choice to all attribute definitions in the selection • Per-entity processing — Reads each entity’s current string, runs parseString and adjustString, and writes back the new string using the proper VLA setter (TagString or TextString) • Undo-safe update — Starts an UNDO mark before making changes and ends it afterwards, so the user can revert the entire batch in a single undo operation • Persistent defaults — Saves the last used numeric increment and location string to the registry and global variables, so the dialog auto-fills them next time • Negative number support — Optional global flag GlbVarInvAllowNeg allows proper recognition and editing of signed numbers
Result:
• Updated text content — All selected TEXT, MTEXT, ATTRIB, and ATTDEF objects have their targeted numeric portions incremented or decremented by the specified amount • Preserved formatting — Non-numeric characters, prefixes, suffixes, and MTEXT control codes remain unchanged, so labels and expressions keep their layout • Consistent precision — Decimal numbers are adjusted with respect to their existing precision (and the increment) with trailing zeros padded when required • Batch-friendly — Multiple selected entities are processed in one run with a single UNDO group, allowing quick sweeping renumbering or value adjustments • User convenience — Last used settings are remembered, making repeated plus/minus operations fast with minimal extra input
Images, animations etc.
Log in to download.
Log in
Log in
Additional info:
Learn more:
Open Website
Share this page:
Subscribe
Login
0 Comments
Oldest
