home *** CD-ROM | disk | FTP | other *** search
- ;******TY\CHAW.LSP******
- (if (null tb) (setq tb 0.0))
- ;----------
- (defun C:CHAW ( )
- (setq ppp (ssget))
- (setq nw (getreal "enter new width <0.5>:"))
- (if (null nw) (setq nw 0.5))
- (setq nw (* tb 100 nw))
- (setq se (getvar "elevation"))
- (setq st (getvar "thickness"))
- (setq wcy 0 n (sslength ppp))
- (while (< wcy n)
- (setq ss (ssname ppp wcy))
- (setq s (cdr (assoc 0 (setq e (entget ss)))))
- (if (= "POLYLINE" s)
- (command "pedit" ss "w" nw ""))
- (if (or (= "LINE" s) (= "ARC" s))
- (command "pedit" ss "y" "w" nw ""))
- (if (= "CIRCLE" s) (cirtopl))
- (if (= "TRACE" s) (tratopl))
- (prompt "Working...")
- (setq wcy (1+ wcy))
- )
- (setvar "elevation" se)
- (setvar "thickness" st)
- (setvar "highlight" 1)
- )
- (defun tratopl ( )
- (entdel ss)
- (setq p1 (cdr (assoc 38 e)))
- (if (null p1) (setvar "elevation" 0.0) (setvar "elevation" p1))
- (setq p2 (cdr (assoc 39 e)))
- (if (null p2) (setvar "thickness" 0.0) (setvar "thickness" p2))
- (setq p1 (cdr (assoc 10 e)) p2 (cdr (assoc 11 e)))
- (setq p01 (list (* (+ (car p1) (car p2)) 0.5)
- (* (+ (cadr p1) (cadr p2)) 0.5)))
- (setq p1 (cdr (assoc 12 e)) p2 (cdr (assoc 13 e)))
- (setq p23 (list (* (+ (car p1) (car p2)) 0.5)
- (* (+ (cadr p1) (cadr p2)) 0.5)))
- (command "pline" p01 "w" nw nw p23 "")
- )
- (defun cirtopl (/ p1 r)
- (entdel ss)
- (setq p1 (cdr (assoc 38 e)))
- (if (null p1) (setvar "elevation" 0.0) (setvar "elevation" p1))
- (setq r (cdr (assoc 39 e)))
- (if (null r) (setvar "thickness" 0.0) (setvar "thickness" r))
- (setq p1 (cdr (assoc 10 e)) r (cdr (assoc 40 e)))
- (command "pline" (polar p1 0.0 r)
- "w" nw nw "a" "ce" p1 "angle" 180 "close")
- )