;>>> TEXT-Search&Replace.GXM ;>>> Search and replace text on your drawing. ;>>> Written by: Vincent Ferrara 2006 ;************************************************** ;>>> Description: ;>>> FIrstly, enter the text you want to find. ;>>> Secondly, enter the text you wish to replace it with. ;>>> Thirdly, select the text to process. ;>>> The search is case sensitive. ;>>> This macro only works with GCP5 and above. ;>>> Acknowledgments: ;>>> Tom Albright, Milan Vlasak and Bjorn Holmgren for their ;>>> suggestions and testing. ; /MSP,++,/XMD,++; /VLC,; MO; AL,??,/VIN,2,$VAL,AL,++; SY,??,/VIN,3,$VAL,SY,++; /SYS,C,V,/VST,0,$STR; /STR,S,$S(0),1,1,/VIN,5,$STR; /IF,$I(5)[LT]5,/GTO,OLDVERSION; /EXT,S,1,2; /GET,TextExplode,/VIN,6,$VAL; /SET,TextExplode,0; ; .SEARCH; /PMT,3,'Press [ESC] TO CONTINUE AFTER ENTERING TEXT',#; /PMT,2,'[Case sensitive search]',#; /PMT,1,'Enter Text to Search...> ',#; TL,$X(2)+100,$Y(2)+100,~; /IF,$DERR[EQ]-2,/GTO,EXIT; OO; /VST,1,$STR; .REPLACE; /PMT,1,'Text to Search... [',$S(1),']',#; /PMT,2,'Enter Text to Replace with...> ',#; TL,$X(2)+100,$Y(2)+100,~; /IF,$DERR[EQ]-2,/GTO,EXIT; OO; /VST,2,$STR; ; .SELECT; /PMT,2,'And Replacing with... [',$S(2),']',#; /PMT,3,'[RET] to Select Text lines to process or [ESC] to Cancel',#,/CIN; /IF,$DERR[EQ]-2,/GTO,EXIT; /SEL,Select Text Lines to process ...; /CEL,F,T,!,A,!,L,!; /VIN,0,$VAL; /IF,$I(0)[EQ]0,/GTO,EXIT; /VIN,1,$I(0)+1; /PMT,3,'[ESC] to Cancel',#; ; .LOOP; /IF,$DERR[EQ]-2,/GTO,EXIT; /VIN,1,$I(1)-1; /IF,$I(1)[EQ]0,/GTO,EXIT; /EEX,$I(1),V,8,A,/VST,3,$STR; /STR,R,$S(3),$S(1),$S(2); /VST,4,$STR; /EEX,$I(1),V,8,N,$S(4); /GTO,LOOP; ; .OLDVERSION; /BEEP; /PMT,1,'< SORRY > This macro only works with GCP5 and above ',#; /PMT,2,'Please click on [www.generalcadd.com] and check out the new features on offer ',#; /PMT,3,'Press any key to continue',#,/CIN; /IF,$STR[EQ]W,/APX,http://www.generalcadd.com,!; ; .EXIT; /IF,$I(2)[EQ]0,AL,--; /IF,$I(3)[EQ]0,SY,--; WD,$X(1),$Y(1),$X(2),$Y(2); /IF,$I(6)[EQ]1,/SET,TextExplode,1; /XMD,--,/MSP,--,PU;