home *** CD-ROM | disk | FTP | other *** search
- (vmon)
-
- (defun drl (/ a n td two b yn fd temp temp1)
- (setq a 0 temp xy temp1 nil)
- (setq n (length temp))
- (while (< a n)
- (if (/= (setq b (nth a temp)) 'nil)
- (setq temp1 (cons b temp1) temp (subst 'nil b temp))
- )
- (setq a (1+ a))
- )
- (setq temp1 (reverse temp1) n (length temp1) a 0 b nil temp nil)
- (while (< a n)
- (setq td nil two (+ cengao (cadr jd)) b (nth a temp1) fd nil)
- (if (= ymin b) (progn
- (setq td (cons two td) td (cons (car jd) td))
- (command "PLINE" td "W" width width jd "")
- (setq se (entlast))
- (ssadd se ss)))
- (if (= ymax b) (progn
- (setq yn (abs (- ymax ymin)))
- (setq td (cons two td) td (cons (+ yn (car jd)) td))
- (setq fd (cons (cadr jd) fd) fd (cons (+ yn (car jd)) fd))
- (command "PLINE" fd "W" width width td "")
- (setq se (entlast))
- (ssadd se ss)))
- (if (and (/= ymin b) (/= ymax b)) (progn
- (setq td (cons (- two bho) td) td (cons (+ (abs (- b ymin)) (car jd)) td))
- (setq fd (cons (cadr jd) fd) fd (cons (+ (abs (- b ymin)) (car jd)) fd))
- (command "PLINE" fd "W" width width td "")
- (setq se (entlast))
- (ssadd se ss )
- ))
- (setq a (1+ a))
- )
- )
-
- (defun kx (/ a n ak nk bk1 b jdy fy fx td1 td2 kbg)
- (setq a 0 n (length lxy) fy (cadr jd))
- (while (< a n)
- (setq td1 nil td2 nil kbg 1 jdy (+ cengao (cadr jd)))
- (if (eq fg "Col")
- (setq b (cadr (nth a lxy)))
- (setq b (car (nth a lxy)))
- )
- (if (or (eq px "L") (eq px "U")) (progn
- (if (> b ymin)
- (setq fx (+ (car jd) (- b ymin)))
- (setq fx (abs (- (car jd) (- ymin b))))
- )
- (if (and (> b ymin) (< b ymax)) (setq jdy (- jdy bho))
- ))
- )
- (if (or (eq px "R") (eq px "D")) (progn
- (if (< b ymin)
- (setq fx (+ (car jd) (abs (- b ymin))))
- (setq fx (abs (- (car jd) (- b ymin))))
- )
- (if (and (< b ymin) (> b ymax)) (setq jdy (- jdy bho))
- ))
- )
- (if (= (type mlxy) 'LIST) (progn
- (setq ak 0 nk (length mlxy) bk (car (nth ak mlxy)))
- (while (< ak nk)
- (setq bk1 (car (nth ak mlxy)) bk2 (car (nth (1+ ak) mlxy)))
- (if (or (equal bk1 fx width)
- (equal bk2 fx width)
- (and (>= bk1 fx) (<= bk2 fx))
- (and (<= bk1 fx) (>= bk2 fx)))
- (setq kbg 0 ak nk))
- (setq ak (+ ak 2))
- )
- ))
- (if (= kbg 1) (progn
- (command "LAYER" "M" "SWALL" "C" "7" "" "")
- (setq td1 (cons fy td1) td1 (cons fx td1) td2 (cons jdy td2) td2 (cons fx td2))
- (command "LINE" td1 td2 "")
- (setq se (entlast))
- (ssadd se ss)
- ))
- (setq a (1+ a))
- )
- )
-
- (defun ban (/ fd1 fd2 td1 td2 jg pt1 pt2 jxs jxl temp)
- (setq temp nil)
- (setq temp xy)
- (command "LAYER" "M" "SBAN1" "C" "7" "" "")
- (setq x1 (apply 'max temp))
- (setq xl (apply 'min temp))
- (setq temp (subst 0.0 x1 temp))
- (setq x2 (apply 'max temp))
- (setq ws (abs (- x1 x2)) temp xy)
- (setq temp (subst 999999.0 xl temp))
- (setq xl2 (apply 'min temp))
- (setq wl(abs (- xl2 xl)))
- (setq fd1 nil td1 nil fd2 nil td2 nil jg (abs (- ymax ymin)))
- (setq jxs (+ (car jd) ws) jxl (+ (car jd) (abs (- jg wl))))
- (setq pt1 (+ cengao (cadr jd)) pt2 (- pt1 width2))
- (setq fd1 nil fd2 nil td1 nil td2 nil)
- (setq fd1 (cons pt2 fd1) fd1 (cons jxs fd1) td1 (cons pt2 td1) td1 (cons jxl td1))
- (command "pline" fd1 td1 "")
- (setq se (entlast))
- (ssadd se ss)
- (command "LAYER" "M" "SBAN2" "C" "7" "" "")
- (setq fd2 (cons (- pt2 bho) fd2) fd2 (cons jxs fd2) td2 (cons (- pt2 bho) td2) td2 (cons jxl td2))
- (command "pline" fd2 td2 "")
- (setq se (entlast))
- (ssadd se ss)
- (setq fd1 nil fd2 nil td1 nil td2 nil)
- (setq fd1 (cons pt1 fd1) fd1 (cons jxs fd1) td1 (cons pt1 td1) td1 (cons (- jxs qw) td1))
- (setq fd2 (cons (- pt1 qh) fd2) fd2 (cons jxs fd2) td2 (cons (- pt1 qh) td2) td2 (cons (- jxs qw) td2))
- (command "solid" fd1 td1 fd2 td2 "")
- (setq se (entlast))
- (ssadd se ss)
- (setq fd1 nil fd2 nil td1 nil td2 nil)
- (setq fd1 (cons pt1 fd1) fd1 (cons jxl fd1) td1 (cons pt1 td1) td1 (cons (+ jxl qw) td1))
- (setq fd2 (cons (- pt1 qh) fd2) fd2 (cons jxl fd2) td2 (cons (- pt1 qh) td2) td2 (cons (+ jxl qw) td2))
- (command "solid" fd1 td1 fd2 td2 "")
- (setq se (entlast))
- (ssadd se ss)
- )
-
- (defun st (/ n a pt1 pt2 t1 t2 fd1 fd2 td1 td2 pmin pmax x1 x2 xy1 xy2 xy22 t1 t11 y)
- (command "layer" "M" "SOTHER" "C" "7" "" "")
- (setq n (length pj) a 0)
- (while (< a (1- n))
- (setq pt1 nil pt2 nil fd1 nil fd2 nil td1 nil td2 nil)
- (setq pt1 (nth a pj) pt2 (nth (1+ a) pj) pmax ( max pt1 pt2) pmin (min pt1 pt2))
- (setq y (- (cadr jd) (* 1.5 (getvar "userr1"))))
- (if (or (eq px "L") (eq px "U"))
- (if (< pmax ymax)
- (setq x1 (abs (- ymin pmin)) x2 (abs (- ymin pmax)) t1 (car jd) xy1 (abs (- (car jd) x1)) xy2 (abs (- (car jd) x2)) xy22 (- xy2 50.0) t11 (- t1 width2) t2 (+ t1 150.0))
- (setq x1 (abs (- ymax pmax)) x2 (abs (- ymax pmin)) t1 (+ (car jd) (abs (- ymax ymin))) xy1 (+ t1 x1) xy2 (+ t1 x2) xy22 (+ xy2 50.0) t11 (+ t1 width2) t2 (- t1 150.0))))
- (if (or (eq px "R") (eq px "D"))
- (if (< pmax ymax)
- (setq x1 (abs (- ymax pmin)) x2 (abs (- ymax pmax)) t1 (+ (car jd) (abs (- ymax ymin))) xy1 (+ t1 x1) xy2 (+ t1 x2) xy22 (+ xy2 50.0) t11 (+ t1 width2) t2 (- t1 150.0))
- (setq x1 (abs (- ymin pmax)) x2 (abs (- ymin pmin)) t1 (car jd) xy1 (abs (- (car jd) x1)) xy2 (abs (- (car jd) x2)) xy22 (- xy2 50.0) t11 (- t1 width2) t2 (+ t1 150.0))))
- (setq fd1 (cons y fd1) fd1 (cons xy1 fd1))
- (setq td1 (cons y td1) td1 (cons t2 td1))
- (setq fd2 (cons (+ y 100.0) fd2) fd2 (cons xy2 fd2))
- (setq td2 (cons (+ y 100.0) td2) td2 (cons t2 td2))
- (command "solid" fd1 td1 fd2 td2 "")
- (setq se (entlast))
- (ssadd se ss)
- (setq fd1 nil fd2 nil td1 nil td2 nil)
- (setq fd1 (cons (+ y 100.0) fd1) fd1 (cons t1 fd1) td1 (cons (+ y 100.0) td1) td1 (cons t2 td1))
- (setq fd2 (cons (+ y 180.0) fd2) fd2 (cons t1 fd2) td2 (cons (+ y 180.0) td2) td2 (cons t2 td2))
- (command "solid" fd1 td1 fd2 td2 "")
- (setq se (entlast))
- (ssadd se ss)
- (setq fd1 nil fd2 nil td1 nil td2 nil)
- (setq fd1 (cons (+ y 300.0) fd1) fd1 (cons xy1 fd1) fd2 (cons (+ y 300.0) fd2) fd2 (cons xy2 fd2))
- (setq td1 (cons y td1) td1 (cons xy1 td1) td2 (cons y td2) td2 (cons xy2 td2))
- (command "SOLID" fd1 td1 fd2 td2 "")
- (setq se (entlast))
- (ssadd se ss)
- (setq fd1 nil fd2 nil td1 nil td2 nil)
- (setq fd1 (cons (+ y terraceh) fd1) fd1 (cons xy1 fd1))
- (setq fd2 (cons (+ y terraceh) fd2) fd2 (cons xy22 fd2))
- (setq td1 (cons (+ y 300.0) td1) td1 (cons xy1 td1))
- (setq td2 (cons (+ y 300.0) td2) td2 (cons xy22 td2))
- (command "line" fd1 td1 "")
- (setq se (entlast))
- (ssadd se ss)
- (command "line" fd2 td2 "")
- (setq se (entlast))
- (ssadd se ss)
- (setq td1 nil td2 nil)
- (setq td1 (cons (+ y terraceh) td1) td1 (cons t11 td1))
- (command "line" fd1 td1 "")
- (setq se (entlast))
- (ssadd se ss)
- (setq a (+ a 2)))
- )
-
- (defun jmw (/ x y fd1 td1 fd2 td2 d1 x jx1 jx2 jyd jyu y F1 F2 F12 F22)
- (command "layer" "M" "swindow" "c" "7" "" "")
- (setq x (car jd) y (cadr jd) fd1 nil td1 nil fd2 nil td2 nil ind nil)
- (setq jx1 (+ (abs (- j1 ymin)) x) jx2 (+ (abs (- j2 ymin)) x) jyd (+ y wh) jyu (+ jyd h))
- (if (eq fg "Col") (setq d1 (cadr in)) (setq d1 (car in)))
- (setq inx (+ (abs (- d1 ymin)) x) iny (+ jyd (/ h 2)))
- (setq ind (cons iny ind) ind (cons inx ind))
- (setq fd1 (cons jyu fd1) fd1 (cons jx1 fd1) td1 (cons jyu td1) td1 (cons jx2 td1))
- (setq fd2 ( cons (+ jyu (/ l 10)) fd2) fd2 (cons jx1 fd2) td2 (cons (+ jyu (/ l 10)) td2) td2 (cons jx2 td2))
- (command "solid" fd1 td1 fd2 td2 "")
- (setq se (entlast))
- (ssadd se ss)
- (setq fd1 nil fd2 nil td1 nil td2 nil f1 nil f2 nil f12 nil f22 nil)
- (if (or (eq px "L") (eq px "U"))
- (setq x1 (+ jx1 width2) x2 (- jx2 width2))
- (setq x1 (- jx1 width2) x2 (+ jx2 width2)))
- (if (> wh 0)
- (setq y1 jyu y2 (+ jyd width2))
- (setq y1 jyu y2 jyd))
- (setq fd1 (cons y1 fd1) fd1 (cons x1 fd1) td1 (cons y2 td1) td1 (cons x1 td1))
- (setq fd2 (cons y1 fd2) fd2 (cons x2 fd2) td2 (cons y2 td2) td2 (cons x2 td2))
- (setq f1 (cons jyd f1) f1 (cons jx1 f1) f2 (cons jyd f2) f2 (cons jx2 f2))
- (setq f12 (cons jyd f12) f12 (cons (+ jx1 width2) f12) f22 (cons jyd f22) f22 (cons (+ jx2 width2) f22))
- (setq mlxy (cons f1 mlxy) mlxy (cons f2 mlxy))
- (setq oldsn (entlast))
- (command "break" "c" f1 f12 fd1 td1)
- (while (/= (setq oldsn (entnext oldsn)) nil) (ssadd oldsn ss))
- (setq oldsn (entlast))
- (command "break" "c" f2 f22 fd2 td2)
- (while (/= (setq oldsn (entnext oldsn)) nil) (ssadd oldsn ss))
- (if (> wh 0) (progn
- (setq fd1 nil td1 nil att "CC")
- (setq fd1 (cons jyd fd1) fd1 (cons x1 fd1) td1 (cons jyd td1) td1 (cons x2 td1))
- (command "PLINE" fd1 "W" width width td1 "")
- (setq se (entlast))
- (ssadd se ss))
- (setq att "DOOR")
- )
- (setq ww (/ (+ w width) 10) ll (/ h 100))
- (setq atf (strcat (itoa h) " " (itoa wh)))
- (command "INSERT" att ind ll ww 90 atf)
- (setq se (entlast))
- (ssadd se ss)
- )
-
- (defun mmw (/ mx pt1 pt2 pt3 pt4 my)
- (command "layer" "M" "spwindow" "c" "7" "" "")
- (if (= fg "Col")
- (setq pt1 (cadr in))
- (setq pt1 (car in))
- )
- (if (or (eq px "L") (eq px "U"))
- (if (> pt1 ymin)
- (setq mx (+ (car jd) (- pt1 ymin)))
- (setq mx (abs (- (car jd) (abs (- ymin pt1)))))
- )
- )
- (if (or (eq px "R") (eq px "D"))
- (if (< pt1 ymin)
- (setq mx (+ (car jd) (abs (- pt1 ymin))))
- (setq mx (abs (- (car jd) (abs (- pt1 ymin)))))
- )
- )
- (setq pt1 nil pt2 nil pt3 nil pt4 nil my (+ (cadr jd) h wh))
- (setq pt1 (cons my pt1) pt1 (cons (- mx (/ l 2)) pt1) pt2 (cons my pt2) pt2 (cons (+ mx (/ l 2)) pt2))
- (setq mlxy (cons pt1 mlxy) mlxy (cons pt2 mlxy))
- (setq pt3 (cons (- my h) pt3) pt3 (cons (- mx (/ l 2)) pt3) pt4 (cons (- my h) pt4) pt4 (cons (+ mx (/ l 2)) pt4))
- (command "pline" pt3 "W" 1.0 1.0 pt4 pt2 pt1 "C")
- (setq se (entlast))
- (ssadd se ss)
- )
-
- (defun pinput (/ WID)
- (initget (+ 2 4))
- (setq censu (getint "\n╩Σ╚δ▓π╩²<2>:"))
- (if (= censu nil) (setq censu 2))
- (initget (+ 2 4))
- (setq cengao (getint "\n╩Σ╚δ▓π╕▀<3500>:"))
- (if (= cengao nil) (setq cengao 3500))
- (initget (+ 2 4))
- (setq bho (getint "\n╩Σ╚δ┬Ñ░σ║±╢╚<120>:"))
- (if (= bho nil) (setq bho 120))
- (if (>= bho cengao) (paoerr "┬Ñ░σ║±╢╚┤≤╙┌▓π╕▀!"))
- (initget (+ 2 4))
- (setq qh (getint "\n╩Σ╚δ╚ª┴║╕▀╢╚<240>:"))
- (if (= qh nil) (setq qh 240))
- (if (>= qh cengao) (paoerr "╚ª┴║╕▀╢╚┤≤╙┌▓π╕▀!"))
- (initget (+ 2 4))
- (setq qw (getint "\n╩Σ╚δ╚ª┴║┐φ╢╚<240>:"))
- (if (= qw nil) (setq qw 240))
- (initget (+ 2 4))
- (setq wid (getreal "\n╩Σ╚δ╞╩╧▀╗µ═╝┐φ╢╚(mm)<0.5>:"))
- (if (= wid nil) (setq wid 0.5))
- (setq bl (getvar "USERR1") width (* wid bl) width2 (/ width 2.0))
- (graphscr)
- (initget 1 "File")
- (setq jd (getpoint "\n╞╩├µ═╝┤µ┼╠F/<▓σ╚δ╗∙╡π>:"))
- (if (= jd "File") (progn
- (setq flag "File")
- (setq pas t)
- (while pas
- (setq file (getstring "\n╞╩├µ═╝╬─╝■├√:"))
- (if (findfile (strcat file ".DWG")) (progn
- (initget "Yes No")
- (setq kword (getkword "\n╕├╬─╝■╥╤╛¡┤µ╘┌,╓╪╨┤┬≡(Y/N)"))
- (if (= kword "Yes") (setq pas nil))
- ) (setq pas nil))
- )
- (setq jd (getpoint "\n▓σ╚δ╗∙╡π:")) ))
- (initget (+ 2 4) "Col Row")
- (setq fg (getkword "\n╤í╘±╞╩╟╨╧▀╨╬╩╜:/║ß╞╩Col/╫▌╞╩Row <Col>:"))
- (if (= fg nil) (setq fg "Col"))
- (if (eq fg "Col") (progn
- (initget (+ 2 4) "L R")
- (setq px (getkword "\n╤í╘±: ╧≥╫≤┐┤L/╧≥╙╥┐┤R <L>:"))
- (if (= px nil) (setq px "L"))
- )
- (progn
- (initget (+ 2 4) "U D")
- (setq px (getkword "\n╤í╘±: ╧≥╔╧┐┤U/╧≥╧┬┐┤D <U>:"))
- (if (= px nil) (setq px "U"))
- )
- )
- (setvar "ORTHOMODE" 1)
- (initget 1)
- (setq p1 (getpoint "\n╩Σ╚δ╞╩╟╨╧▀╡┌╥╗╡π:"))
- (initget 1)
- (setq p2 (getpoint p1 "\n╩Σ╚δ╞╩╟╨╧▀╡┌╢■╡π:"))
- (setq p3 (getpoint p2 "\n╩Σ╚δ╞╩╟╨╧▀╡┌╚²╡π:"))
- (if (/= p3 nil) (progn
- (initget 1)
- (setq p4 (getpoint p3 "\n╩Σ╚δ╞╩╟╨╧▀╓╒╡π:"))
- ))
- (while (= sj nil)
- (princ "\n╤í╘±╞╩╟╨╩╡╠σ:")
- (setq sj (ssget))
- )
- (setq sL (sslength sj))
- (princ "\n╒²╘┌╝∞╦≈...╟δ╔╘║≥!")
- )
-
- (defun lij ( / b b2)
- (if (and (= (TYPE jxy) 'LIST) (= jbg 0)) (progn
- (setq b 0 jbg 1)
- (if (eq fg "Col") (setq b2 (cadr b1)) (setq b2 (car b1)))
- (while (< b njxy)
- (if (<= (abs (- (nth b jxy) b2)) width)
- (setq b njxy a2 n bg 0)
- (setq b (+ b 1))
- )
- )
- )
- )
- )
-
- (defun lilr (/ b bg a1 a2 jbg v v1 v2 v3 e e1)
- (setq b 0 bg 0 a1 0 a2 2 jbg 0 e nil e1 nil)
- (setq e1 (mapcar 'car lxy2))
- (if (eq px "L") (setq e (apply 'min e1)) (setq e (apply 'max e1)))
- (while (< a1 n)
- (setq b1 (nth a1 lxy2))
- (while (< a2 (- n 1))
- (setq c1 (nth a2 lxy2) c2 (nth (+ a2 1) lxy2))
- (if (eq px "L") (setq v (car c1) v1 (car c2) v2 (car b1) v3 v2)
- (setq v (car b1) v1 v v2 (car c1) v3 (car c2))
- )
-
- (if (and (or (/= (car c1) (car b1)) (/= (cadr c1) (cadr b1)))
- (or (/= (car c2) (car b1)) (/= (cadr c2) (cadr b1))))
- (if (or (> v v2) (> v1 v3))
- (if (or (and (> (cadr c1) (cadr b1)) (> (cadr c2) (cadr b1)))
- (and (< (cadr c1) (cadr b1)) (< (cadr c2) (cadr b1))))
- (progn
- (setq bg 1)
- (lij)
- )
- (setq bg 0 a2 n)
- )
- (progn (setq bg 1) (lij))
- )
- )
- (setq a2 (+ a2 2)))
- (if (and (= bg 1) (> (abs (- (car b1) e)) 370.0))
- (setq lxy (cons b1 lxy)))
- (setq a2 0 bg 0 jbg 0)
- (setq a1 (+ a1 1)))
- )
-
- (defun lidu (/ b bg a1 a2 jbg v v1 v2 v3 e e1)
- (setq b 0 bg 0 a1 0 a2 2 jbg 0 e nil e1 nil)
- (setq e1 (mapcar 'cadr lxy2))
- (if (eq px "U") (setq e (apply 'max e1)) (setq e (apply 'min e1)))
- (while (< a1 n)
- (setq b1 (nth a1 lxy2))
- (while (< a2 (- n 1))
- (setq c1 (nth a2 lxy2) c2 (nth (+ a2 1) lxy2))
- (if (eq px "D") (setq v (cadr c1) v1 (cadr c2) v2 (cadr b1) v3 v2)
- (setq v (cadr b1) v1 v v2 (cadr c1) v3 (cadr c2))
- )
- (if (and (or (/= (car c1) (car b1)) (/= (cadr c1) (cadr b1)))
- (or (/= (car c2) (car b1)) (/= (cadr c2) (cadr b1))))
- (if (or (> v v2) (> v1 v3))
- (if (or (and (> (car c1) (car b1)) (> (car c2) (car b1)))
- (and (< (car c1) (car b1)) (< (car c2) (car b1))))
- (progn
- (setq bg 1)
- (lij)
- )
- (setq bg 0 a2 n)
- )
- (progn (setq bg 1) (lij))
- )
- )
- (setq a2 (+ a2 2)))
- (if (and (= bg 1) (> (abs (- (cadr b1) e)) 370.0))
- (setq lxy (cons b1 lxy)))
- (setq a2 0 bg 0 jbg 0)
- (setq a1 (+ a1 1)))
- )
- (defun range (tab / w c d mn mx)
- (setq c (mapcar 'car tab) mn (apply 'min c) mn (1- mn))
- (while (< mn (setq mx (apply 'max c)))
- (setq c (subst mn mx c))
- (while (setq d (assoc mx tab))
- (setq tab (subst '(nil) d tab) w (cons d w))
- )
- )
- )
-
-
- (defun sli (/ a lay li t1 pl pg)
- (setq a 0 lxy2 nil)
- (if (= p3 nil) (setq pl p1 pg p1) (progn
- (if (and (eq px "L") (<= (car p1) (car p3)))
- (setq pl p1 pg p3)
- )
- (if (and (eq px "R") (>= (car p1) (car p3)))
- (setq pl p3 pg p1)
- )
- (if (and (eq px "U") (<= (cadr p1) (cadr p3)))
- (setq pl p1 pg p3)
- )
- (if (and (eq px "D") (>= (cadr p1) (cadr p3)))
- (setq pl p3 pg p1)
- )
- ))
- (while (<= a (1- sL))
- (SETQ PT1 NIL PT2 Nil jo nil t1 0)
- (setq sn (ssname sj a))
- (setq s1 (entget sn))
- (setq li (cdr (assoc 0 s1)) lay (cdr (assoc 8 s1)))
- (if (and (eq li "LINE") (eq (substr lay 1 5) "PWALL")) (progn
- (setq pt (cdr (assoc 10 s1)))
- (if (= (type pt) 'LIST) (progn
- (setq pt1 (cons (cadr pt) pt1) pt1 (cons (car pt) pt1))
- (setq pt (cdr (assoc 11 s1)))
- (setq pt2 (cons (cadr pt) pt2) pt2 (cons (car pt) pt2))
- (if (and (eq px "L") (< (car pt1) (car pl))
- (< (car pt2) (car pl)))
- (setq t1 1)
- )
- (if (and (eq px "R")
- (> (car pt1) (car pg))
- (> (car pt2) (car pg)))
- (setq t1 1)
- )
- (if (and (eq px "U")
- (> (cadr pt1) (cadr pg))
- (> (cadr pt2) (cadr pg)))
- (setq t1 1)
- )
- (if (and (eq px "D")
- (< (cadr pt1) (cadr pl))
- (< (cadr pt2) (cadr pl)))
- (setq t1 1)
- )
- (if (/= t1 1) (progn
- (setq jo (inters p1 p2 pt1 pt2))
- (if (and (/= p3 nil) (/= (type jo) 'LIST))
- (setq jo (inters p3 p4 pt1 pt2))
- )
- ))
- (if (and (/= (type jo) 'LIST) (= t1 1))
- (if (or (and (eq fg "Col") (/= (cadr pt1) (cadr pt2)))
- (and (eq fg "Row") (/= (car pt1) (car pt2))))
- (setq lxy2 (cons pt2 lxy2) lxy2 (cons pt1 lxy2))))
- )
- )
- (IF (= (TYPE JO) 'LIST) (PROGN
- (if (eq fg "Col")
- (setq jxy (cons (cadr jo) jxy))
- (SETQ jxy (cons (CAR JO) jxy))
- )
- )
- )
- )
- )
- (setq a (1+ a)))
- (if (/= (TYPE LXY2) 'LIST) (paoerr "╞╩╟╨╩╡╠σ╓╨├╗╙╨╟╜!"))
- (setq n (length lxy2) njxy (length jxy))
- (if (eq fg "Col") (lilr) (lidu))
- (if (= (type lxy) 'LIST)
- (setq lxy (range lxy))
- )
- )
-
- (defun instr(st s0 s00 / l n loop x n0 l0)
- (setq l (+ (- (strlen s0) st) 1) l0 0 n0 st n 1 loop t)
- (while (and (<= n l) loop)
- (setq x (substr s0 n0 1))
- (if (eq x s00) (setq loop nil l0 n0) (setq n0 (1+ n0) n (1+ n)))
- )
- (eval l0)
- )
-
- (defun asctof(rn1 / loop ll x)
- (setq loop t)
- (while loop
- (setq ll (instr 1 rn1 " "))
- (if (= ll 0) (setq wl (cons rn1 wl) loop nil)
- (progn ;else
- (setq x (substr rn1 1 (1- ll)))
- (setq wl (cons x wl))
- (setq rn1 (substr rn1 (1+ ll) (- (strlen rn1) ll)))
- (setq loop t)
- )
- )
- )
- )
-
- (defun smw ( / a s1 s2 s3 rn ne px1 py1 pt1 pt2 blkn x ll li lay ti lw wl)
- (setq a 0)
- (while (<= a (1- sL))
- (SETQ PT1 NIL PT2 NIL ti 0)
- (setq sn (ssname sj a))
- (setq s1 (entget sn))
- (setq li (cdr (assoc 0 s1)) lay (cdr (assoc 8 s1)))
- (if (and (eq li "INSERT") (eq lay "PWINDOW")) (progn
- (setq blkn (cdr (Assoc 2 s1)))
- (setq in (cdr (assoc 10 s1)))
- (if (or (= (substr blkn 1 3) "CCA") (= (substr blkn 1 3) "CCZ"))
- (progn
- (setq ne (entnext sn) s2 (entget ne))
- (setq rn (cdr (assoc 1 s2)) wl nil)
- (asctof rn)
- (setq l (atoi (nth 3 wl)) h (atoi (nth 2 wl)) wh (atoi (nth 1 wl)) w (atoi (nth 0 wl)))
- (setq ne (entnext ne) s3 (entget ne))
- (setq rn (cdr (assoc 1 s3)) wl nil)
- (asctof rn)
- (setq ag (atof (nth 0 wl)))
- )
- (progn
- (setq ag (cdr (assoc 50 s1)))
- (setq ne (entnext sn))
- (setq s2 (entget ne))
- (setq rn (cdr (assoc 1 s2)) wl nil)
- (asctof rn)
- (setq l (atoi (nth 3 wl)) h (atoi (nth 2 wl)) w (atoi (nth 0 wl)) wh (atoi (nth 1 wl)))
- )
- )
- (if (eq fg "Col")
- (if (or (equal ag (/ pi 2) 0.001) (equal ag (* pi 1.5) 0.001) (equal ag (* pi 2.5) 0.001)) (setq lw w) (setq lw l))
- (if (or (equal ag 0.0 0.001) (equal ag pi 0.001) (equal ag (* 2 pi) 0.001)) (setq lw w) (setq lw l))
- )
- (if (and (eq px "L") (= p3 nil) (>= (car p1) (- (car in) (/ lw 2))))
- (setq ti 1)
- )
- (if (and (eq px "L") (/= p3 nil))
- (if (< (cadr p1) (cadr p4))
- (if (< (cadr in) (cadr p2))
- (if (>= (car p2) (- (car in) (/ lw 2))) (setq ti 1))
- (if (>= (car p3) (- (car in) (/ lw 2))) (setq ti 1))
- )
- (if (< (cadr in) (cadr p2))
- (if (>= (car p3) (- (car in) (/ lw 2))) (setq ti 1))
- (if (>= (car p2) (- (car in) (/ lw 2))) (setq ti 1))
- )
- )
- )
- (if (and (eq px "R") (= p3 nil) (<= (car p1) (+ (car in) (/ lw 2))))
- (setq ti 1)
- )
- (if (and (eq px "R") (/= p3 nil))
- (if (< (cadr p1) (cadr p4))
- (if (< (cadr in) (cadr p2))
- (if (<= (car p2) (+ (car in) (/ lw 2))) (setq ti 1))
- (if (<= (car p3) (+ (car in) (/ lw 2))) (setq ti 1))
- )
- (if (< (cadr in) (cadr p2))
- (if (<= (car p3) (+ (car in) (/ lw 2))) (setq ti 1))
- (if (<= (car p2) (+ (car in) (/ lw 2))) (setq ti 1))
- )
- )
- )
- (if (and (eq px "U") (= p3 nil) (<= (cadr p1) (+ (cadr in) (/ lw 2))))
- (setq ti 1)
- )
- (if (and (eq px "U") (/= p3 nil))
- (if (< (car p1) (car p4))
- (if (< (car in) (car p2))
- (if (<= (cadr p2) (+ (cadr in) (/ lw 2))) (setq ti 1))
- (if (<= (cadr p3) (+ (cadr in) (/ lw 2))) (setq ti 1))
- )
- (if (< (car in) (car p2))
- (if (<= (cadr p3) (+ (cadr in) (/ lw 2))) (setq ti 1))
- (if (<= (cadr p2) (+ (cadr in) (/ lw 2))) (setq ti 1))
- )
- )
- )
- (if (and (eq px "D") (= p3 nil) (>= (cadr p1) (- (cadr in) (/ lw 2))))
- (setq ti 1)
- )
- (if (and (eq px "D") (/= p3 nil))
- (if (< (car p1) (car p4))
- (if (< (car in) (car p2))
- (if (>= (cadr p2) (- (cadr in) (/ lw 2))) (setq ti 1))
- (if (>= (cadr p3) (- (cadr in) (/ lw 2))) (setq ti 1))
- )
- (if (< (car in) (car p2))
- (if (>= (cadr p3) (- (cadr in) (/ lw 2))) (setq ti 1))
- (if (>= (cadr p2) (- (cadr in) (/ lw 2))) (setq ti 1))
- )
- )
- )
- (if (= ti 1) (progn
- (setq wm (cons wh wm) wm (cons w wm) wm (cons h wm) wm (cons l wm) wm (cons in wm) wm (cons ag wm))
- (if (and (eq fg "Col") (not (equal AG (/ PI 2) 0.001)) (not (equal AG (* PI 1.5) 0.001)) (not (equal ag (* 2.5 pi) 0.001)))
- (progn
- (setq pt1 nil pt2 nil)
- (setq px1 (- (car in) (/ L 2)) py1 (- (cadr in) (/ W 2)))
- (setq pt1 (cons py1 pt1) pt1 (cons px1 pt1))
- (setq px1 (+ (car in) (/ L 2)))
- (setq pt2 (cons py1 pt2) pt2 (cons px1 pt2))
- (setq ji (inters p1 p2 pt1 pt2))
- (if (and (/= p3 nil) (/= (type ji) 'LIST))
- (setq ji (inters p3 p4 pt1 pt2))
- )
- (if (= (type ji) 'LIST) (progn
- (setq mxy (cons (cadr ji) mxy) wm (cons (cadr ji) wm))
- ))
- (setq px1 (- (car in) (/ L 2)) py1 (+ (cadr in) (/ W 2)))
- (SETQ PT1 NIL PT2 NIL)
- (setq pt1 (cons py1 pt1) pt1 (cons px1 pt1))
- (setq px1 (+ (car in) (/ L 2)))
- (setq pt2 (cons py1 pt2) pt2 (cons px1 pt2))
- (setq ji (inters p1 p2 pt1 pt2))
- (if (and (/= p3 nil) (/= (type ji) 'LIST))
- (setq ji (inters p3 p4 pt1 pt2))
- )
- (if (= (type ji) 'LIST) (progn
- (setq mxy (cons (cadr ji) mxy) wm (cons (cadr ji) wm) wm (cons "J" wm))
- ))
- )
- )
- (IF (AND (EQ FG "Row") (not (equal AG 0.0 0.001)) (not (equal AG PI 0.001)) (not (equal ag (* 2 pi) 0.001)))
- (progn
- (SETQ PT1 NIL PT2 NIL)
- (setq py1 (- (cadr in) (/ L 2)) PX1 (- (CAR IN) (/ W 2)))
- (setq pt1 (cons py1 pt1) pt1 (cons px1 pt1))
- (SETQ py1 (+ (cadr in) (/ L 2)))
- (setq pt2 (cons py1 pt2) pt2 (cons px1 pt2))
- (setq ji (inters p1 p2 pt1 pt2))
- (if (and (/= p3 nil) (/= (type ji) 'LIST))
- (setq ji (inters p3 p4 pt1 pt2))
- )
- (IF (= (TYPE JI) 'LIST) (progn
- (setq mxy (cons (car ji) mxy) wm (cons (car ji) wm))
- ))
- (setq py1 (- (cadr in) (/ L 2)) px1 (+ (car in) (/ W 2)))
- (SETQ PT1 NIL PT2 NIL)
- (setq pt1 (cons py1 pt1) pt1 (cons px1 pt1))
- (setq py1 (+ (CADR IN) (/ L 2)))
- (SETQ PT2 (CONS PY1 PT2) PT2 (CONS PX1 PT2))
- (setq ji (inters p1 p2 pt1 pt2))
- (if (and (/= p3 nil) (/= (type ji) 'LIST))
- (setq ji (inters p3 p4 pt1 pt2))
- )
- (IF (= (TYPE JI) 'LIST) (progn
- (setq mxy (cons (car ji) mxy) wm (cons (car ji) wm) wm (cons "J" wm))
- ))
- )
- )
- )
- )
- )
- )
- (setq a (1+ a)))
- )
-
- (defun spl (/ li lay a)
- (setq a 0 pxy0 nil)
- (while (<= a (1- sL))
- (SETQ PT1 NIL PT2 NIL)
- (setq sn (ssname sj a))
- (setq s1 (entget sn))
- (setq li (cdr (assoc 0 s1)) lay (cdr (assoc 8 s1)))
- (if (and (eq li "POLYLINE") (eq lay "TERRACE")) (progn
- (setq ne (entnext sn) terraceh (cdr (assoc 39 s1)))
- (setq s2 (entget ne))
- (while (/= (cdr (assoc 0 s2)) "SEQEND")
- (setq pd (cdr (assoc 10 s2)) pxy0 (cons pd pxy0))
- (setq ne (entnext ne) s2 (entget ne))
- )
- (setq n (length pxy0) pa 0)
- (while (< pa (1- n))
- (setq pt1 (nth pa pxy0) pt2 (nth (1+ pa) pxy0))
- (setq jo (inters (list (car p1) (cadr p1)) (list (car p2) (cadr p2))
- (list (car pt1) (cadr pt1)) (list (car pt2) (cadr pt2))))
- (if (and (/= p3 nil) (/= (type jo) 'LIST))
- (setq jo (inters (p3 p4 (list (car pt1) (cadr pt1)) (list (car pt2)
- (cadr pt2)))))
- )
- (if (= (type jo) 'LIST) (progn
- (if (eq fg "Col") (setq pj (cons (cadr jo) pj)) (setq pj (cons (car jo) pj)))
- )
- (progn
- (setq pxy (cons pt2 pxy))))
- (setq pa (+ pa 1)))
- (setq pxy0 nil)))
- (setq a (1+ a)))
- )
-
- (defun aj (/ y1 y1n y2 y2n)
- (if (or (eq px "U") (eq px "L")) (progn
- (if (= (type jxy) 'LIST) (setq y1 (apply 'min jxy) y1n (apply 'max jxy))
- (setq y1 999999.0 y1n 0.0))
- (if (= (type mxy) 'LIST) (setq y2 (apply 'min mxy) y2n (apply 'max mxy))
- (setq y2 999999.0 y2n 0.0))
- (if (<= y1 y2) (setq ymin y1) (setq ymin y2))
- (if (<= y1n y2n) (setq ymax y2n) (setq ymax y1n))
- ))
- (if (or (eq px "D") (eq px "R")) (progn
- (if (= (type jxy) 'LIST) (setq y1 (apply 'max jxy) y1n (apply 'min jxy))
- (setq y1 0.0 y1n 999999.0))
- (if (= (type mxy) 'LIST) (setq y2 (apply 'max mxy) y2n (apply 'min mxy))
- (setq y2 0.0 y2n 999999.0))
- (if (<= y1 y2) (setq ymin y2) (setq ymin y1))
- (if (<= y1n y2n) (setq ymax y1n) (setq ymax y2n))
- ))
- (if (= (type mxy) 'LIST) (setq xy (append mxy xy)))
- (if (= (type jxy) 'LIST) (setq xy (append jxy xy)))
- )
-
- (defun ph (/ fd td x1 x2 y1 y2 ag1 ag2)
- (setq fd nil td nil)
- (command "LAYER" "M" "PBH" "C" "7" "" "")
- (if (eq fg "Col")
- (if (/= p4 nil) (setq x1 (car p1) x2 (car p4))
- (setq x1 (car p1) x2 x1)
- ))
- (if (eq fg "Row")
- (if (/= p4 nil) (setq y1 (cadr p1) y2 (cadr p4))
- (setq y1 (cadr p1) y2 y1)
- ))
- (if (eq px "L")
- (setq y1 (- ymin (* 10 bl)) y2 (+ ymax (* 10 bl)) ag1 180 ag2 0))
- (if (eq px "R")
- (setq y1 (+ ymin (* 10 bl)) y2 (- ymax (* 10 bl)) ag1 0 ag2 180))
- (if (eq px "U")
- (setq x1 (- ymin (* 10 bl)) x2 (+ ymax (* 10 bl)) ag1 90 ag2 270))
- (if (eq px "D")
- (setq x2 (- ymax (* 10 bl)) x1 (+ ymin (* 10 bl)) ag1 270 ag2 90))
- (setq fd (cons y1 fd) fd (cons x1 fd) td (cons y2 td) td (cons x2 td))
- (command "INSERT" "PB2" fd 1 1 ag2)
- (command "INSERT" "PB1" td 1 1 ag1)
- (if (and (eq fg "Col") (/= p3 nil)) (progn
- (if (< (cadr p1) (cadr p4)) (progn
- (if (< (car p2) (car p3)) (progn
- (command "INSERT" "PB3" p2 1 1 270)
- (command "INSERT" "pb3" p3 1 1 90))
- (progn
- (command "INSERT" "PB3" p2 1 1 180)
- (command "INSERT" "PB3" p3 1 1 0))
- )) (progn
- (if (< (car p2) (car p3)) (progn
- (command "INSERT" "PB3" p2 1 1 0)
- (command "INSERT" "pb3" p3 1 1 180))
- (progn
- (command "INSERT" "PB3" p2 1 1 90)
- (command "INSERT" "PB3" p3 1 1 270))
- )))
- ))
- (if (and (eq fg "Row") (/= p3 nil)) (progn
- (if (< (car p1) (car p4)) (progn
- (if (< (cadr p2) (cadr p3)) (progn
- (command "INSERT" "PB3" p2 1 1 90)
- (command "INSERT" "pb3" p3 1 1 270))
- (progn
- (command "INSERT" "PB3" p2 1 1 180)
- (command "INSERT" "PB3" p3 1 1 0))
- )) (progn
- (if (< (cadr p2) (cadr p3)) (progn
- (command "INSERT" "PB3" p2 1 1 0)
- (command "INSERT" "pb3" p3 1 1 180))
- (progn
- (command "INSERT" "PB3" p2 1 1 270)
- (command "INSERT" "PB3" p3 1 1 90))
- )))
- ))
- )
-
-
- (defun mw1 ( / f s a b a2 a3 n n2 nlxy jbg bg ay1 ay2 ax1 ax2 axmax aymin aymax axmin)
- (if (= (type wm) 'LIST) (progn
- (setq nlxy (length lxy2))
- (setq n (length wm) a 0 temp wm)
- (while (< a n)
- (setq b (nth a wm) a2 0 a3 0 jbg 0 bg 0)
- (if (= b "J") (progn
- (setq j1 (nth (+ a 1) wm) j2 (nth (+ a 2) wm) ag (nth (+ a 3) wm) in (nth (+ a 4) wm))
- (setq l (nth (+ a 5) wm) h (nth (+ a 6) wm) w (nth (+ a 7) wm) wh (nth (+ a 8) wm) a (+ a 8))
- (setq jbg 1)
- (jmw)))
- (if (and (eq fg "Col") (/= b "J") (not (equal b 0.0 0.001)) (not (equal b pi 0.001)) (not (equal b (* pi 2) 0.001)))
- (progn
- (setq in (nth (+ a 1) wm) l (nth (+ a 2) wm) h (nth (+ a 3) wm) w (nth (+ a 4) wm) wh (nth (+ a 5) wm) a (+ a 5))
- (setq iny (cadr in) inx (car in))
- (while (< a2 nlxy)
- (setq f (nth a2 lxy2) ay1 (cadr f) ax1 (car f) s (nth (1+ a2) lxy2) ay2 (cadr s) ax2 (car s))
- (setq aymax (max ay1 ay2) aymin (min ay1 ay2) axmax (max ax1 ax2) axmin (min ax1 ax2))
- (if (eq px "L") (progn
- (if (and (> axmin inx) (> aymax (+ iny (/ l 2))) (< aymin (- iny (/ l 2))))
- (setq a2 nlxy bg 0)
- (setq bg 1 a2 (+ a2 2)))
- )
- (progn
- (if (and (< axmin inx) (> aymax (+ iny (/ l 2))) (< aymin (- iny (/ l 2))))
- (setq a2 nlxy bg 0)
- (setq bg 1 a2 (+ a2 2)))
- )
- ))))
- (if (and (eq fg "Row") (/= b "J") (not (equal b (* pi 0.5) 0.001)) (not (equal b (* pi 1.5) 0.001)) (not (equal b (* 2.5 pi) 0.001)))
- (progn
- (setq in (nth (+ a 1) wm) l (nth (+ a 2) wm) h (nth (+ a 3) wm) w (nth (+ a 4) wm) wh (nth (+ a 5) wm) a (+ a 5))
- (setq inx (car in) iny (cadr in))
- (while (< a2 nlxy)
- (setq f (nth a2 lxy2) ax1 (car f) ay1 (cadr f) s (nth (1+ a2) lxy2) ax2 (car s) ay2 (cadr s))
- (setq axmax (max ax1 ax2) axmin (min ax1 ax2) aymax (max ay1 ay2) aymin (min ay1 ay2))
- (if (eq px "U") (progn
- (if (and (< aymax iny) (> axmax (+ inx (/ l 2))) (< axmin (- inx (/ l 2))))
- (setq a2 nlxy bg 0)
- (setq bg 1 a2 (+ a2 2)))
- )
- (progn
- (if (and (> aymin iny) (> axmax (+ inx (/ l 2))) (< axmin (- inx (/ l 2))))
- (setq a2 nlxy bg 0)
- (setq bg 1 a2 (+ a2 2)))
- )
- ))))
- (if (and (= bg 1) (/= b "J")) (progn
- (setq n2 (length temp))
- (while (< A3 N2)
- (setq b2 (nth a3 temp))
- (if (= b2 "J") (setq a3 (+ a3 3)))
- (if (and (eq fg "Col") (/= b2 "J") (not (equal b2 0.0 0.001)) (not (equal b2 pi 0.001)) (not (equal b2 (* 2 pi) 0.001)))
- (progn
- (setq in2 (nth (1+ a3) temp) l2 (nth (+ a3 2) temp))
- (setq iny2 (cadr in2) inx2 (car in2))
- (setq ii (abs (- iny2 (cadr in))) ll (+ (/ l 2) (/ l2 2)))
- (if (and (eq px "L") (> inx2 (car in)) (< ii ll))
- (setq bg 0))
- (if (and (eq px "R") (< inx2 (car in)) (< ii ll))
- (setq bg 0))))
- (if (and (eq fg "Row") (/= b2 "J") (not (equal b2 (/ pi 2) 0.001)) (not (equal b2 (* pi 1.5) 0.001)) (not (equal b2 (* pi 2.5) 0.001)))
- (progn
- (setq in2 (nth (1+ a3) temp) l2 (nth (+ a3 2) temp))
- (setq iny2 (cadr in2) inx2 (car in2))
- (setq ii (abs (- inx2 (car in))) ll (+ (/ l 2) (/ l2 2)))
- (if (and (eq px "U") (< iny2 (cadr in)) (< ii ll))
- (setq bg 0))
- (if (and (eq px "D") (> iny2 (cadr in)) (< ii ll))
- (setq bg 0))))
- (setq a3 (+ a3 6))
- )))
- (if (= bg 1) (progn
- (if (equal (abs (cos b)) 0.0 0.001) (setq l l) (setq l (* l (abs (cos b)))))
- (mmw))
- )
- (if (or (= jbg 1) (= bg 1) (= a2 nlxy)) (setq a (1+ a)))
- (if (and (= jbg 0) (= bg 0) (/= a2 nlxy)) (setq a (+ a 6)))
- )))
- )
-
-
- (defun paoerr(s)
- (if (/= s "Function cancelled")
- (princ (strcat "\nError:" s))
- )
- (command "layer" "s" "0" "")
- (setvar "cmdecho" 1)
- (setq *error* oer)
- (princ)
- )
-
- (defun C:PAO (/ oer a n n1 n2 sj sn ne pt1 pt2 px1 px2 py1 pd pa x1 xl ws x2 a2 a3
- ax1 iny ay1 temp ag bg ii ll nlxy jbg pxy0 sl p1 p2 p3 p4 jd px fg qw qh bho cengao
- censu width width2 ymin ymax jxy lxy wm mxy xy pxy pj lxy2 s1 li lay jo y1 y1n
- y2 y2n b v v1 b1 njxy pxy0 s2 se ss rn yn xl2 wl t1 t2 x y fd1 td1 fd2
- td2 jx1 j1 jx2 j2 jyd jyu wh h xmax xmin c f1 f2 cm l l2 w in j ji in in2 inx iny2
- axmin axmax aymin aymax ax1 ay1 ax2 ay2 mn mx d file kword flag mlxy)
- (setvar "cmdecho" 0);(setq oer *error* *error* paoerr)
- (if (/= (+ fh78 fh65 fh72 fh85 fh70) 370) (tst))
- (setq sj nil sl nil p1 nil p2 nil p3 nil p4 nil jd nil px nil fg nil qh nil qw nil bho nil cengao nil censu nil)
- (setq width nil width2 nil ymax nil ymin nil jxy nil lxy nil mlxy nil wm nil mxy nil xy nil pxy nil pj nil)
- (pinput)
- (sli)
- (smw)
- (spl)
- (aj)
- (ph)
- (command "layer" "M" "SWALL" "C" "7" "" "")
- (setq ss (ssadd))
- (setq se nil)
- (drl)
- (ban)
- (load "lisp\\sst") (sst)
- (mw1)
- (if (= (type lxy) 'LIST) (kx))
- (if (= (type pj) 'LIST) (st))
- (setq jxy nil lxy nil lxy2 nil wm nil mxy nil xy nil pxy nil pj nil )
- (setq entl (entlast))
- (if (> censu 1) (command "array" ss "" "R" censu 1 cengao))
- (command)
- (if (eq flag "File") (progn
- (while (/= (setq entl (entnext entl)) nil) (ssadd entl ss))
- (if (eq kword "Yes") (command "wblock" file "Y" "" jd ss "") (command "wblock" file "" jd ss ""))))
- (command "layer" "s" "0" "")
- (setvar "cmdecho" 1) (setq *error* oer) (princ)
- )