PDA

View Full Version : Toggle text case within a block



Mr Cory
2007-05-03, 04:36 AM
Does anyone have a lisp that changes the case (or toggles between) upper/lower/title? I have done a search but only got ones for stand alone text and mtext plus there is the express tool. Just not one that effect mtext in a block. Any help is appreciated Cheers

Opie
2007-05-03, 01:48 PM
Have you tried using the Express Tools while in the Block Editor?

Mr Cory
2007-05-03, 08:46 PM
I just wanted something quick and easy without having to go into the block editor if it was possible. I have one the works perfect for attributes thanks to Fixo ;)

watsonlisp
2007-05-04, 05:55 PM
;This autolisp program changes text case in a block.



(DEFUN C:CTCB2 ()
(PROMPT "\n*CHANGE TEXT CASE IN BLOCK* ")
(SETQ NTE (CAR (NENTSEL "\nSelect text to change: ")))
(INITGET "U u L l")
(SETQ TCT (GETKWORD "\nEnter case for text[Upper/Lower]: "))
(SETQ NTEL (ENTGET NTE))
(SETQ NTEV (ASSOC 1 NTEL))
(SETQ NTEVS (CDR NTEV))
(IF (OR (= TCT "U") (= TCT "u")) (SETQ NNTEV (CONS 1 (STRCASE NTEVS))))
(IF (OR (= TCT "L") (= TCT "l")) (SETQ NNTEV (CONS 1 (STRCASE NTEVS 1))))
(SETQ NNTEL (SUBST NNTEV NTEV NTEL))
(ENTMOD NNTEL)
(ENTUPD NTE)
(PRINC)
);END CTCB2

Mr Cory
2007-05-06, 03:46 AM
Thank you, thats what i was after :)