Kelley Marshall of Richmond, Virginia, requested a routine that performs a number of text-replacement functions, including: switching selected values of text, attributes and cells in a table object; replacing selected values of text, attributes and cells in a table object with the value of the first one selected; and switching groups of cells in a table object by selecting them with a window. This month's AutoLISP Solution includes multiline text objects as well as text, attribute values and the contents of cells in tables. Figure 1 shows a test drawing that has all of the objects that can be used to replace or switch.
Two versions of the program are available -- TSWITCH-SHX.LSP and TSWITCH-TTF.LSP. The SHX designation is for the standard shape file fonts, and the TTF designation is for TrueType fonts. I made this distinction because the command prompt is slightly different for setting the different types fonts. The programs run only in AutoCAD 2005 and 2006 because earlier versions don't contain table objects and they haven't been tested.
|