home *** CD-ROM | disk | FTP | other *** search
- ;****** PM\EMCB.LSP ****** 11-24-89 BJ
- (if (null zh) (setq zh (* 350 tb)))
- ; (if (/= (getvar "textstyle") "HZTEXT2")
- ; (command "style" "" "txt,hztxt" "" 1.0 "" "" "" ""))
- (command "style" "" "" 0.0 1.0 "" "" "")
- ;-----------
- (defun C:EMCB ( )
- (if (null eee) (ppp0))
- (setq wcy 1)
- (while wcy
- (setq mode (getint "\n 1.select:MCDH/2.editMCB/3.MCname/4.TJname
- /5.cha-str <or RETRUN for none>:"))
- (if (null mode) (setq wcy nil))
- (if (= mode 1) (ppp0))
- (if (= mode 2) (emcb0))
- (if (= mode 3) (progn (setq wxr "MC") (insczh "mcname")))
- (if (= mode 4) (progn (setq wxr "TJ") (insczh "mctjh")))
- (if (= mode 5) (chastr))
- )
- )
- ;------------
- (defun ppp0 ( )
- (print "Select MCDH:")
- (setq ppp (ssget))
- (setq k 0 n (sslength ppp) eee nil)
- (while (< k n)
- (setq s1 (ssname ppp k) s10 (entget s1))
- (if (= (cdr (assoc 0 s10)) "TEXT")
- (setq eee (cons s1 eee)))
- (setq k (1+ k))
- )
- )
- ;------------
- (defun emcb0 ( )
- (setq e2 (car (entsel "Select XM:")))
- (if e2 (setq e20 (entget e2) p2x (car (cdr (assoc 10 e20)))))
- (setq k 0 n (length eee))
- (while (< k n)
- (setq e1 (nth k eee) e10 (entget e1))
- (redraw e1 3)
- (if (= (substr (cdr (assoc 1 e20)) 1 5) " ├┼┤░") (emcb01))
- (if (= (substr (cdr (assoc 1 e20)) 1 4) "╢┤┐┌") (emcb02))
- (if (= (substr (cdr (assoc 1 e20)) 1 4) "▓╔╙├") (emcb03))
- (if (= (substr (cdr (assoc 1 e20)) 1 4) "═╝╝»") (emcb04))
- (redraw e1 4)
- (setq k (1+ k))
- )
- )
- ;------------
- (defun emcb01 ( )
- (redraw e2 3)
- (setq e (car (entsel "Select HZ-string:")))
- (if e (setq e0 (entget e) e0 (cdr (assoc 1 e0))))
- (if e0 (command "text" "c" (list (+ p2x (* 14.5 zh))
- (cadr (cdr (assoc 10 e10)))) (cdr (assoc 40 e10)) 0.0 e0))
- (redraw e2 4)
- )
- ;-----------
- (defun emcb02 ( )
- (redraw e2 3)
- (setq e10s (cdr (assoc 1 e10)))
- (setq new (strcase (substr e10s 1 1)))
- (if (or (= new "M") (= new "C")) (setq e10s (strcat
- (substr e10s 2 2) "00X" (substr e10s 4 2) "00"))
- (setq e10s "1200X1800"))
- (setq new (getstring (strcat "enter DKCC<" e10s ">:")))
- (if (/= new "") (setq e10s new))
- (command "text" "c" (list (+ p2x (* 5.5 zh))
- (cadr (cdr (assoc 10 e10)))) (cdr (assoc 40 e10)) 0.0 e10s)
- (redraw e2 4)
- )
- ;------------
- (defun emcb03 ( )
- (redraw e2 3)
- (setq e (car (entsel "Select HZ-string:")))
- (if e (setq e0 (entget e) e0 (cdr (assoc 1 e0))))
- (if e0 (command "text" "c" (list (+ p2x (* 3.0 zh))
- (cadr (cdr (assoc 10 e10)))) (cdr (assoc 40 e10)) 0.0 e0))
- (redraw e2 4)
- )
- ;-----------
- (defun emcb04 ( )
- (redraw e2 3)
- (setq e10s (cdr (assoc 1 e10)))
- (setq new (getstring (strcat "enter TJZDH<" e10s ">:")))
- (if (/= new "") (setq e10s new))
- (command "text" "c" (list (+ p2x (* 4.0 zh))
- (cadr (cdr (assoc 10 e10)))) (cdr (assoc 40 e10)) 0.0 e10s)
- (redraw e2 4)
- )
- ;-------
- (defun insczh (fn1)
- (setq pt (getpoint "enter point pt:"))
- (setq ptx (car pt) pty (cadr pt))
- (setq zh (getdist "\n Height <3.5>:" pt))
- (if (null zh) (setq zh 3.5)) (setq zh (* tb 100 zh))
- (setq fn1 (strcat "hz/" fn1 ".czh"))
- (setq f1 (open fn1 "r"))
- (setq s12 (read-line f1))
- (setq k 0)
- (while k
- (setq s12 (read-line f1))
- (if (= s12 nil) (setq k nil) (progn
- (if (= wxr "MC") (progn
- (setq s02 (cadr (read s12)))
- (command "text" (list ptx (+ pty (* k -1.2 zh))) zh 0.0 s02)))
- (if (= wxr "TJ") (progn
- (setq s01 (car (read s12)))
- (command "text" (list ptx (+ pty (* k -2.0 zh))) zh 0.0 s01)
- (setq s02 (cadr (read s12)))
- (command "text" (list (+ ptx (* 6 zh)) (+ pty (* k -2.0 zh)))
- zh 0.0 s02)))
- (setq k (1+ k)))
- )
- )
- (close f1)
- )
- ;------------
- (defun chastr ( )
- (print "Select string:")
- (setq ppp (ssget))
- (setq k 0 n (sslength ppp))
- (while (< k n)
- (setq e1 (ssname ppp k))
- (setq e10 (entget e1))
- (redraw e1 3)
- (setq new (getstring (strcat
- "enter new string<" (cdr (assoc 1 e10)) ">:")))
- (if (/= new "") (progn
- (setq e10 (subst (cons 1 new) (assoc 1 e10) e10))
- (entmod e10)))
- (redraw e1 4)
- (setq k (1+ k))
- )
- )
- ;-----------
- ;(defun C:CLEAN2 ( )
- ; (setq atomlist (member 'C:CLEAN2 atomlist))
- ; (princ)
- ;)