Short description
Purpose: Add or remove prefixes and suffixes (with wildcard patterns) and round numeric text content for TEXT/MTEXT/ATTRIB/INSERT attributes Core idea: Use fixed-string and wildcard-based string comparisons to strip or template-rebuild text, plus optional rounding of numeric strings Persistence: Remembers last-used settings in environment variables (PSOT_*) for fast reuse across sessions and commands

Command:
Main command: PREF_SUFF_OKR_TXT — opens the Prefix/Suffix/Round dialog and applies the chosen operation Quick commands: • PREF — uses stored prefix Add/Remove values and applies prefix operation directly • SUFF — uses stored suffix Add/Remove values and applies suffix operation directly • OKR_TXT — uses stored digit count and rounds numeric text directly Selection: Prompts to select TEXT, MTEXT, INSERT (first ATTRIB only), and standalone ATTRIB entities for processing
Description:
The routine provides a DCL-based interface where you can choose between three actions: Prefix, Suffix, or Digits (rounding). Depending on the row selected, you can specify Add and Remove templates for prefix or suffix, or a number of digits for rounding numeric text. Prefix and Suffix operations support both fixed strings and wildcard templates that can capture parts of the original text and reinsert them using “*” and “?” placeholders, while the Remove side can strip matching patterns or wildcards from the beginning or end. The rounding option scans text content and converts numeric-only strings to rounded values with the specified number of decimal digits, leaving nonnumeric text unchanged. All operations can be reused without reopening the dialog by calling the PREF, SUFF, or OKR_TXT helper commands that rely on stored values.
Helper function: (if any)
• PSOT-Get / PSOT-Put — Read and write persistent settings (PSOT_ACT, PSOT_PFX_ADD, PSOT_PFX_REM, PSOT_SFX_ADD, PSOT_SFX_REM, PSOT_DIG) via environment variables • PSOT-Starts-With / PSOT-Ends-With — Simple string prefix/suffix checks for non-wildcard patterns • PSOT-Reverse — Reverses a string to help implement suffix wildcard matching via prefix logic • PSOT-Pattern-All-Stars — Verifies if the rest of the wildcard pattern consists only of “*” characters • PSOT-WC-Match-CAP-Core — Core recursive wildcard matcher with capture, handling “*” and “?” and returning match length and captured substring • PSOT-WC-Prefix-Match-CAP / PSOT-WC-Suffix-Match-CAP — Anchored wildcard matching at start or end of a string, with capture support • PSOT-Has-Wild — Detects whether a string contains “*” or “?” wildcards • PSOT-ReplaceAllChar — Replaces all occurrences of a single character in a string with a replacement substring • PSOT-Template-Apply — Applies a template string to a source text by replacing “?” and “*” with the original text • PSOT-AddPrefix / PSOT-AddSuffix — Adds fixed or wildcard-templated prefix/suffix to the text • PSOT-RemovePrefix / PSOT-RemoveSuffix — Removes fixed or wildcard-templated prefix/suffix, keeping captured wildcard portions where appropriate • PSOT-RoundNumberString — Parses a numeric string with distof and formats it with rtos to a given number of decimal digits • PSOT-EntType / PSOT-ReadText / PSOT-WriteText — Small wrappers for reading/writing DXF group 1 text content based on entity type • PSOT-FirstAttribOfInsert — Finds the first ATTRIB under an INSERT by walking entnext links until ATTRIB or SEQEND is found • PSOT-Transform — Dispatches text through the appropriate transform operation (prefix add/remove, suffix add/remove, or rounding) • PSOT-ProcessOne-Op — Applies the chosen transform to a single entity, including first attribute of a block insert when applicable • PSOT-Iterate-Selection-Op — Prompts selection and loops through the selection set, calling PSOT-ProcessOne-Op for each entity • PSOT-TempDclFile / PSOT-RunDialog — Build, load, and manage the temporary DCL dialog, including enabling/disabling inputs based on selected radio button and saving the user’s last choices
Functionalities:
• Prefix add/remove — Add or strip prefixes to/from text, with either literal strings or wildcard patterns that can embed or preserve parts of the original text • Suffix add/remove — Add or strip suffixes similarly, with anchored wildcard matching at the end of the string • Wildcard templates — Patterns can use “*” and “?” such that the original text is reinserted into a new structured form (e.g., “PRE_*_SUF”, “?OLD?”) • Safe numeric rounding — Numeric-only texts are converted to rounded values with a given number of decimal digits, while non-numeric text is left unchanged • Per-entity text source — For INSERT, only the first attribute’s text is modified; for TEXT/MTEXT/ATTRIB, the DXF 1 text string is directly edited • Dialog radio logic — Uses USERR1 system variable and radio buttons to switch between Prefix, Suffix, and Digits modes, enabling/disabling relevant input fields dynamically • Persistent UI state — Stores the last active mode and input values (prefix/suffix add/remove strings and rounding digits) so they appear pre-filled next time • One-shot and quick commands — You can run the full dialog via PREF_SUFF_OKR_TXT or quickly reapply the last stored prefix, suffix, or rounding via PREF, SUFF, OKR_TXT
Result:
• Transformed text entities — Selected TEXT, MTEXT, ATTRIB, and first attributes of INSERTs have their string content updated based on the chosen prefix, suffix, or rounding rules • Cleaned prefixes/suffixes — Unwanted leading or trailing patterns can be removed, even when partially matched with wildcards, while keeping important captured segments • Formatted numeric text — Number-only labels can be normalized to a consistent decimal precision using the Digits mode • Batch processing summary — After selection, the routine reports how many items were processed, giving quick feedback on scope • Reusable configuration — Users can repeat transformations on new selections without reconfiguring, thanks to stored PSOT_* environment values and helper commands PREF, SUFF, and OKR_TXT
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
