home *** CD-ROM | disk | FTP | other *** search
/ Frostbyte's 1980s DOS Shareware Collection / floppyshareware.zip / floppyshareware / APOG / CHGSTL.ZIP / CHGSTL.LSP
Encoding:
Lisp/Scheme  |  1990-06-29  |  1.0 KB  |  30 lines

  1. ;              CHANGE STYLE
  2. ;  by BILL VALASKI, Jr. for Computer Projects Unlimited (CPU)
  3. ;
  4. ;     This is an advanced lisp macro that changes the text STYLE of any TEXT
  5. ;  items in the chosen selection set. The STYLE specified as the new style must
  6. ;  be already loaded, otherwise no conversion will be done.
  7.  
  8. (defun C:CHGSTYL (/ p NEWSTYL1 l n OLDSTYL NEWSTYL e)
  9.     (setq CL 1)                    ;Set load bit on
  10.     (setq p (ssget))                ;Get selection set
  11.         (if p (progn
  12.          (SETQ NEWSTYL1
  13.             (GETSTRING "\nEnter the new text style: ")) ;New text style...
  14.            (setq l 0)
  15.            (setq n (sslength p))
  16.            (while (< l n)
  17.               (if (= "TEXT"
  18.                      (cdr (assoc 0
  19.                        (setq e (entget (ssname p l))))))
  20.                  (progn
  21.                    (SETQ NEWSTYL (CONS 7 NEWSTYL1))    ;Creates dotted pair
  22.                    (SETQ OLDSTYL (ASSOC '7 E))
  23.                    (ENTMOD (SUBST NEWSTYL OLDSTYL E))
  24.                  )
  25.               )
  26.               (setq l (1+ l))
  27.            )
  28.         ))
  29. )
  30.