home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Black Box 4
/
BlackBox.cdr
/
autocad
/
txtcase.arj
/
CASE.LSP
Wrap
Lisp/Scheme
|
1991-06-03
|
1KB
|
34 lines
(defun c:case (/ e ee txt ap pb)
(setq ap (getvar "aperture"))
(setq pb (getvar "pickbox"))
(setvar "aperture" 10)
(setvar "pickbox" 10)
(prompt "\n****** TeXt CaSe CoNvErSiOn by CADD Masters ******")
(prompt "\nTo convert only the first letter set object snap to INSERT before selecting.")
(setq ee (entsel "\nSelect text: "))
(while ee
(setq e (entget (car ee)))
(if (= (cdr (assoc 0 e)) "TEXT")
(progn
(setq txt (cdr (assoc 1 e)))
(if (equal (cadr ee) (cdr (assoc 10 e)))
(if (<= (ascii (substr txt 1 1)) 90)
(setq txt (strcat (strcase (substr txt 1 1) t) (substr txt 2)))
(setq txt (strcat (strcase (substr txt 1 1)) (substr txt 2)))
)
(if (<= (ascii (substr txt 1 1)) 90)
(setq txt (strcase txt t))
(setq txt (strcase txt))
)
)
(setq e (subst (cons 1 txt) (assoc 1 e) e))
(entmod e)
)
)
(setq ee (entsel "\nSelect text: "))
)
(setvar "aperture" ap)
(setvar "pickbox" pb)
(prin1)
)