Sort / Purpose: Convert selected TEXT and MTEXT entities to either all upper case or all lower case in a single operation.
β’ Scope: Operates only on existing TEXT and MTEXT objects that you select in the drawing.
β’ Goal: Standardize the letter case of annotations quickly for consistent drawing documentation.
Command:
Command name: CASE
How to run: Type CASE in the command line and press Enter.
Description:
β’ Selection: Prompts the user to select TEXT and MTEXT entities to be modified.
β’ Case Option: Lets the user choose between converting to Upper or Lower case, with Upper as the default when Enter is pressed.
β’ Processing: Reads each entityβs text content, converts it, and writes the new value back to the entity.
β’ System Handling: Temporarily disables command echo and precision settings, restoring them afterward.
β’ Failure Handling: Warns the user if no valid text entities are detected in the selection.
Helper function: (if any)β
Used AutoLISP / AutoCAD built-ins:
β’ getvar / setvar: Save and restore CMDECHO and LUPREC values.
β’ ssget / ssname / sslength: Build and iterate through the selection set of text entities.
β’ entget / entmod: Read and rewrite DXF data of each text entity.
β’ assoc / subst: Extract and replace group code 1 (text string).
β’ strcase: Convert existing text to upper or lower case.
β’ initget / getkword: Provide and enforce the βUpper/Lowerβ option selection.
β’ prompt / princ: Display clean messages and terminate silently.
Functionalities:
β’ Supports TEXT & MTEXT: Works on both object types simultaneously.
β’ Uppercase Mode: Converts all selected text content to uppercase.
β’ Lowercase Mode: Converts all selected text content to lowercase.
β’ Default Behavior: Uppercase is automatically used if no choice is provided.
β’ Non-Destructive: Only the string content is modified; all other entity properties remain unchanged.
β’ Environment-Safe: Resets all system variables changed during execution.
Result:
Result: All selected TEXT and MTEXT entities are converted to the chosen case (Upper or Lower) instantly.
β’ Uniform Formatting: Every selected annotation ends with consistent capitalization across the drawing.
β’ Non-destructive: Only the text content changes β layer, style, color, rotation, and position remain untouched.
β’ Clean Execution: System settings are restored automatically, leaving the environment unchanged after the command finishes.
β’ Immediate Feedback: The text updates visually in the drawing as soon as the command loops through all entities.
Copy code:Copy CASE LISP
<ResourceDictionary
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:src="clr-namespace:Autodesk.Windows;assembly=AdWindows">
<src:RibbonToolTip x:Key="Lowercase">
<src:RibbonToolTip.ExpandedContent>
<StackPanel>
<TextBlock Background="AntiqueWhite" TextAlignment="Left">
<Bold>Function Syntax: case</Bold>
<LineBreak/>
<Hyperlink>https://forums.augi.com/showthread.php?53116-AutoLISP-program-coverts-upper-to-lower-or-lower-to-upper-case</Hyperlink>
<LineBreak/>
<Bold>Description</Bold><LineBreak/>
This AutoLISP program <Span Foreground="DarkRed">Lowercase_txt_mtxt.lsp</Span> changes the case of selected <Span Foreground="DarkRed">TEXT</Span> and <Span Foreground="DarkRed">MTEXT</Span> objects.<LineBreak/>
It can convert text to either uppercase or lowercase, based on user choice.<LineBreak/>
<Bold>Functionalities</Bold><LineBreak/>
β’ Select multiple <Span Foreground="DarkRed">TEXT</Span> and <Span Foreground="DarkRed">MTEXT</Span> objects for case conversion.<LineBreak/>
β’ Option to convert all text to <Span Foreground="DarkRed">Upper</Span> or <Span Foreground="DarkRed">Lower</Span> case.<LineBreak/>
β’ Uses <Span Foreground="DarkRed">strcase</Span> function with optional lowercase flag.<LineBreak/>
β’ Works on both single-line and multi-line text entities.<LineBreak/>
β’ Displays a message if no valid text entities are found.<LineBreak/>
<Bold>Important Notes</Bold><LineBreak/>
β’ Command to run this tool: <Span Foreground="DarkRed">CASE</Span>.<LineBreak/>
β’ Defaults to uppercase conversion if no option is specified.<LineBreak/>
β’ Temporarily changes system variables <Span Foreground="DarkRed">CMDECHO</Span> and <Span Foreground="DarkRed">LUPREC</Span> for cleaner operation, then restores them.<LineBreak/>
</TextBlock>
</StackPanel>
</src:RibbonToolTip.ExpandedContent>
</src:RibbonToolTip>
</ResourceDictionary>
Short description Sort / Purpose: Convert selected TEXT and MTEXT entities to either all upper case or all lower case in a single operation. β’ Scope: Operates only on existing TEXT and MTEXT objects that you select in the drawing. β’ Goal: Standardize the letter case of annotations quickly for consistent drawing documentation. Command: Command…
Short description Short LISP to convert selected TEXT and MTEXT objects to uppercase. Command: Command: TC β Converts the string contents of selected TEXT/MTEXT to uppercase. Description: This routine prompts the user to select TEXT and MTEXT entities, then reads every entityβs text content, converts it to uppercase using STRCASE, and rewrites the modified string…
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:…
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…
Short description Purpose: Compute and report a simplified slope ratio and angle between two user-picked points Run style: Interactive two-point measurement with no drawing modifications Standard: Uses a fixed 12-unit horizontal run for imperial slope representation Output: Displays slope ratio and angle through an alert dialog only Command: Command: SLOPE_01 Start: User picks a start…
Short description Purpose: Label slopes between two picked points using multiple numeric and ratio formats Scope: Works entirely in 2D, producing TEXT entities placed and rotated along the measured segment Workflow: Configure options in a dialog (DCL), then pick two points repeatedly to place slope labels Output style: Percent, H:V integers, V:H integers, H:V decimals…
Short description Purpose: Convert REGION objects into closed LWPOLYLINEs while preserving curve continuity and arc bulges Typical use: Cleanup of Boolean-created geometry or boundary extractions that output REGION entities Input object: REGION only β all selected REGIONs are processed Output format: Clean, closed LWPOLYLINE with correct bulges and segment ordering Command: Command name: Region2Polyline How…
Short description Purpose: Offset curves inward or outward and assign the results to a selected layer Supported geometry: *POLYLINE, ARC, CIRCLE, ELLIPSE, SPLINE (planar only) Session memory: Remembers last offset distance, last chosen layer, and last direction for faster repetitive usage Command: Command name: OffsetAndLayer Run method: Type OffsetAndLayer and press Enter Dialog controls: β’…
Leave a Reply
You must be logged in to post a comment.