home *** CD-ROM | disk | FTP | other *** search
- ;********************
- ;**** TY\PPP.LSP ****
- ;******************** 8910 CD
- (defun C:PPP ( )
- (setq ppp (ssget))
- (setq wcy 1)
- (while wcy
- ; (setq mode (getint "\n 0.mppp/1.cstrh/2.cstra/3.cstrw/
- ;4.LAyer/5.Color/6.LType/7.Elev/8.Thickness/9.explode <or RETRUN for none>:"))
- (setq mode (getint "\n 0.mppp/1.cstrh/2.cstra/3.cstrw/
- 4.LA/5.Col/6.LT/7.Elev/8.Th/9.explode/10.blk:"))
- (if (null mode) (setq wcy nil))
- (if (= mode 0) (setq ppp (ssget)))
- (if (= mode 1) (csh))
- (if (= mode 2) (csa))
- (if (= mode 3) (csw))
- (if (= mode 4) (progn (setq dh (getstring "New layer:"))
- (command "change" ppp "" "lay" dh "")))
- (if (= mode 5) (progn (setq dh (getstring "New color:"))
- (command "change" ppp "" "p" "color" dh "")))
- (if (= mode 6) (progn (setq dh (getstring "New ltype<bylayer>:"))
- (if (= dh "") (setq dh "bylayer"))
- (command "change" ppp "" "p" "ltype" dh "")))
- (if (= mode 7) (progn (setq dh (getreal "New elevation:"))
- (command "change" ppp "" "p" "elev" dh "")))
- (if (= mode 8) (progn (setq dh (getreal "New thickness:"))
- (command "change" ppp "" "p" "th" dh "")))
- (if (= mode 9) (exp))
- (if (= mode 10) (eblk))
- )
- )
- ;------------
- (defun csh ( )
- (setq nsh (getreal "enter nsh <3.5>:"))
- (if (null nsh) (setq nsh 3.5))
- (setq nsh (* 100 tb nsh))
- (setq wxr 0 n (sslength ppp))
- (while (< wxr n)
- (setq ss (entget (ssname ppp wxr)))
- (if (= (cdr (assoc 0 ss)) "TEXT") (progn
- (setq ss (subst (cons 40 nsh) (assoc 40 ss) ss))
- (entmod ss)))
- (setq wxr (1+ wxr))
- )
- )
- ;------------
- (defun csa ( )
- (setq nsa (getangle "enter nsa <0.0>:"))
- (if (null nsa) (setq nsa 0.0))
- (setq wxr 0 n (sslength ppp))
- (while (< wxr n)
- (setq ss (entget (ssname ppp wxr)))
- (if (= (cdr (assoc 0 ss)) "TEXT") (progn
- (setq ss (subst (cons 50 nsa) (assoc 50 ss) ss))
- (entmod ss)))
- (setq wxr (1+ wxr))
- )
- )
- ;------------
- (defun csw ( )
- (setq nsw (getreal "enter nsw <1.0>:"))
- (if (null nsw) (setq nsw 1.0))
- (setq wxr 0 n (sslength ppp))
- (while (< wxr n)
- (setq ss (entget (ssname ppp wxr)))
- (if (= (cdr (assoc 0 ss)) "TEXT") (progn
- (setq ss (subst (cons 41 nsw) (assoc 41 ss) ss))
- (entmod ss)))
- (setq wxr (1+ wxr))
- )
- )
- ;------------
- (defun exp ( )
- (setq wxr 0 n (sslength ppp))
- (while (< wxr n)
- (setq ss (ssname ppp wxr))
- (setq s (cdr (assoc 0 (entget ss))))
- (if (or (= s "INSERT") (= s "POLYLINE") (= s "DIMENSION"))
- (command "explode" ss))
- (setq wxr (1+ wxr))
- )
- )
- ;------------
- (defun eblk (/ k s0 s2)
- (setq new (strcase (getstring "new block name:")))
- (setq k 0 n (sslength ppp))
- (while (< k n)
- (setq ss (ssname ppp k))
- (setq s0 (cdr (assoc 0 (setq s2 (entget ss)))))
- (if (and (= s0 "INSERT") (/= (cdr (assoc 2 s2)) new))
- (progn (setq s2 (subst (cons 2 new) (assoc 2 s2) s2))
- (entmod s2)))
- (setq k (1+ k))
- )
- )
- (princ)