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 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:
Images, animations etc.
Log in to download.
Log in
Log in
XAML code:
<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>
Additional info:
Learn more:
Open Website
Share this page:
Subscribe
Login
0 Comments
Oldest
Tags: 🏷️ Autocad Lisps, 🏷️ Text_menu
Tags: 🏷️ Autocad Lisps, 🏷️ Text_menu
