[Search tip detail and code files using keywords, tip number, author name, etc ]
 
    For tip to function correctly, you must ensure that the downloaded file name matches the file name
    displayed in the Rename File To field. Please rename downloaded files when necessary.
Text Routines: Append, Realign, Change Case, and More
Tip# 3206 By Robert Zipprich On 31-May-2009
3
Rated By 1 users Downloaded : 474
Categories : General Text
Software type : AutoCAD 2010
Rename File To : zipprich/,zipprich/.DS_Store,__MACOSX/,__MACOSX/zipprich/,__MACOSX/zipprich/._.DS_Store,zipprich/PREFIX.LSP,__MACOSX/zipprich/._PREFIX.LSP,zipprich/TEXTDUMP.LSP,__MACOSX/zipprich/._TEXTDUMP.LSP,zipprich/TXTAPP.LSP,__MACOSX/zipprich/._TXTAPP.LSP,zipprich/TXTUPCASE.LSP,__MACOSX/zipprich/._TXTUPCASE.LSP,__MACOSX/._zipprich
A collection of AutoLISP routines for manipulating text.

Robert Zipprich also shared this collection of routines that he uses to manipulate text in his drawings.

TXTAPP.LSP: Appends a second text string to the end of the first text string selected.

TXTAPP2: Realigns a 2nd text string below the 1st text string selected.

TXTAPP3: Appends a 2nd text string to the end of 1st text string and inserts a backslash (for fractions).

TXTUPCASE.LSP: Converts selected text from lowercase text to uppercase.

PREFIX.LSP: Adds a specified prefix text string to selected text strings.

SUFFIX: Add a specified suffix text string to selected text strings.

TEXTDUMP.LSP: Writes selected text to an ASCII text file.

See attached LSP files: TXTAPP.LSP, TXTUPCASE.LSP, PREFIX.LSP, TEXTDUMP.LSP

Notes from Cadalyst Tip Patrol: TXTAPP works similarly to the Express Tool TXT2MTXT. It retains the text type (text or mtext) of the original object selected. It does add a few characters to the text string if you start with Text and then add Mtext. Express Tools TXT2MTEXT converts everything to Mtext. TXTAPP2 adds and aligns a second string of text to the first one selected. It doesn’t work so well if you pick text above the first selection, but it will still add them together. TXTAPP3 works just like TXTAPP, except that it adds a backslash between them. TXTUPCASE only works on single-line text. You can change the case of selected text in an Mtext object by right clicking it inside the editor and choosing the Case option. The PREFIX and SUFFIX routines only work with single-line text. TEXTDUMP seemed to have issues dumping mtext, but it worked great with text objects.

 

Average Rating:
3


User comments


Log In