home *** CD-ROM | disk | FTP | other *** search
- (vmon)
-
- (defun awerr(s)
- (if (/= s "Function cancelled")
- (princ (strcat "\nError:" s))
- )
- (command)
- (command "layer" "s" "0" "")
- (command "text" "s" "hz")
- (command)
- (setvar "cmdecho" 1)
- (setvar "pickbox" pib)
- (setvar "highlight" 1)
- (setvar "coords" 0)
- (setq *error* oer)
- (princ)
- )
-
- (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 strdv(rn / loop l x)
- (setq wlist nil loop t)
- (while loop
- (setq l (instr 1 rn " "))
- (if (= l 0) (setq wlist (cons rn wlist) loop nil)
- (progn ;else
- (setq x (substr rn 1 (1- l)))
- (setq wlist (cons x wlist))
- (setq rn (substr rn (1+ l) (- (strlen rn) l)))
- (setq loop t)
- )
- )
- )
- (setq wlist (reverse wlist))
- )
-
- (defun achkmc(c / l0 l1 l2 xh wd hgt ch)
- (setq wlt nil)
- (if (and (> (setq l0 (instr 1 c "=")) 0) (> (setq l1 (instr 1 c "*")) 0) (= (setq l2 (instr 1 c "@")) 0) (> l1 l0)) (progn
- (setq xh (substr c 1 (- l0 1)) wd (substr c (+ l0 1) (- l1 l0 1)) hgt (substr c (+ l1 1)))
- (if (and (findfile (strcat xh ".dwg")) (> (atoi wd) 0) (> (atoi hgt) 0)) (setq lop nil wlt (list xh wd hgt)) (princ "*Error!*"))) (princ "*Error*"))
- )
-
- (defun dtr(a)
- (/ (* 180.0 a) pi)
- )
-
- (setq w 370 sd 250 wmes1 "C-1" whgt "900")
-
- (defun C:ARCWALL(/ sn mp bn x x1 pib oer r1 r2 r3 r4 sp1 sp2 sp3 sp4 ep1 ep2 ep3 ep4 sa1 ea1 ma1 mp1 mp2 sn1 sn2 en1 en2 sp ep cp en p1 p2 insp a1 r loop lop lp fg xh one one0 o1 o2 o3 o4 mc wlt l n n0 ss)
- (setvar "cmdecho" 0)
- (setvar "highlight" 0)
- (setq pib (getvar "pickbox"))
- (setq oer *error* *error* awerr)
- (princ "\n╟╜║± <")
- (princ w)
- (setq x (getint ">:"))
- (if (/= x nil) (setq w x))
- (princ "\n═Γ╟╜║± <")
- (princ sd)
- (setq x (getint ">:"))
- (if (/= x nil) (setq sd x))
- (initget 1 "Center")
- (setq sp (getpoint "\n╘░╨─C/<╞≡╡π>:") flag nil)
- (if (= sp "Center") (progn
- (setq cp (getpoint "\n╘░╨─:"))
- (setq sp (getpoint "\n╞≡╡π:"))
- (setq ep (getpoint "\n╓╒╡π:"))
- )
- (progn
- (initget 1 "Center End")
- (setq sp1 (getpoint "\n╘░╨─C/╓╒╡πE/<╡┌╢■╡π>:"))
- (cond ((= sp1 "Center") (setq cp (getpoint "\n╘░╨─:"))
- (setq ep (getpoint "\n╓╒╡π:")))
- ((= sp1 "End") (setq ep (getpoint "\n╓╒╡π:"))
- (setq cp (getpoint "\n╘░╨─:")))
- (t (setq ep (getpoint "\n╓╒╡π:") flag t))
- )
- ))
- (if (= (tblsearch "layer" "pwalln") nil)(command "layer" "n" "pwalln" "c" 15 "pwalln" ""))
- (if (= (tblsearch "layer" "pwallw") nil)(command "layer" "n" "pwallw" ""))
- (command "layer" "s" "pwalln" "")
- (if flag (progn
- (command "arc" sp sp1 ep)
- (setq sn (entlast))
- )
- (progn
- (command "arc" "c" cp sp ep)
- (setq sn (entlast))
- )
- )
- (setq en (entget sn) r (cdr (assoc 40 en)) a1 (cdr (assoc 50 en)) a2 (cdr (assoc 51 en)))
- (setq insp (cdr (assoc 10 en)))
- (setq p1 (polar insp a1 (- r 100)) p2 (polar insp a1 (+ r 100)))
- (command "offset" sd (list sn (polar insp a1 r)) p2 "")
- (setq sn1 (entlast) en1 (entget sn1))
- (command "change" sn1 "" "p" "la" "pwallw" "")
- (command "offset" (- w sd) (list sn (polar insp a1 r)) p1 "")
- (setq sn2 (entlast) en2 (entget sn2))
- (command "erase" sn "")
- (setq loop t fg t)
- (while loop
- (princ "\n▓Θ╤»?/┤░╠¿╕▀H/╫░╚δL/┤µ┼╠S/╘∞▒φM/═╦│÷X/\n╚▒╩í<")
- (princ wmes1)
- (initget "? M X L S H")
- (setq x (strcase (getstring ">:")))
- (if (/= x "") (setq wmes1 x))
- (cond
- ((= wmes1 "H") (princ "\n┤░╠¿╕▀ <")
- (princ whgt)
- (setq x (getstring ">: "))
- (if (/= x "") (setq whgt x)) )
- ((= wmes1 "L") (setq lop t)
- (while lop
- (setq fnm (getstring "\n╬─╝■├√: "))
- (if (findfile (strcat fnm ".mc")) (progn
- (setq mclist nil)
- (setq f (open (strcat fnm ".mc") "r"))
- (while (/= (setq rn (read-line f)) nil)
- (strdv rn)
- (setq mclist (cons wlist mclist))
- )
- (close f)
- (setq lop nil))
- (princ "**╬─╝■├╗╒╥╡╜!**"))
- ))
- ((= wmes1 "S") (setq lop t)
- (while lop
- (setq fnm (getstring "\n╬─╝■├√: "))
- (if (findfile (strcat fnm ".mc")) (progn
- (initget "Y N")
- (setq x (getkword "**╬─╝■╥╤┤µ╘┌, ╓╪╨┤┬≡ <N>**"))
- ) (setq x "Y"))
- (if (= x "Y") (progn
- (setq f (open (strcat fnm ".mc") "w"))
- (setq n 0 l (length mclist))
- (repeat l
- (setq one (nth n mclist))
- (write-line (strcat (nth 0 one) " " (nth 1 one) " " (nth 2 one) " " (nth 3 one)) f)
- (setq n (1+ n))
- )
- (close f)
- (setq lop nil)
- ))
- ) )
- ((= wmes1 "M") (princ "\n├┼┤░╨═║┼ <C-1>:")
- (setq x (strcase (getstring)))
- (if (= x "") (setq xh "C-1") (setq xh x))
- (if (setq one (assoc xh mclist)) (progn
- (setq lop t)
- (while lop
- (princ "\n├┼┤░╩²╛▌ <")
- (setq one0 (cdr one) o1 (nth 0 one0) o2 (nth 1 one0) o3 (nth 2 one0))
- (princ (setq mc (strcat (strcase o1) "=" o2 "*" o3)))
- (setq x (strcase (getstring ">:")))
- (if (= x "") (setq mc mc) (setq mc x))
- (achkmc mc)
- )
- (setq mclist (subst (cons xh wlt) one mclist))
- )
- (progn ;else
- (setq lop t)
- (while lop
- (while (= (setq x (strcase (getstring "\n├┼┤░╩²╛▌:"))) ""))
- (achkmc x))
- (setq mclist (cons (cons xh wlt) mclist))
- )
- ) ;endif
- ) ;end cond1
- ((= wmes1 "?") (setq l (length mclist) n 0)
- (setq wmes "N")
- (if (> l 0) (progn
- (princ "\n**╨═║┼ ┐Θ├√ ┐φ╢╚ ╕▀╢╚ **")
- (repeat l
- (setq x (nth n mclist))
- (princ "\n ")
- (setq n0 0)(repeat (length x) (princ (read (nth n0 x))) (princ " ") (setq n0 (1+ n0)))
- (setq n (1+ n))
- ))
- (princ "\n*├┼┤░▒φ╓╨╬▐╩²╛▌*")
- ))
- ((= wmes1 "X") (setq loop nil fg nil))
- (t (if (setq one (assoc wmes1 mclist)) (progn
- (setq lp t)
- (while lp
- (initget "Undo X")
- (setq sp (getpoint "\n╗╪═╦U/═╦│÷X/<├┼┤░╞≡╡π>:"))
- (cond ((= sp "Undo") (command "undo" "end" "u"))
- ((= sp "X") (setq lp nil wmes1 sp))
- (t (setvar "coords" 2)
- (setq ep (getpoint sp "\n├┼┤░╓╒╡π:"))
- (setvar "coords" 0)
- (command "undo" "g")
- (setq r1 (cdr (assoc 40 en1)) r2 (cdr (assoc 40 en2)))
- (setq sa1 (angle insp sp) ea1 (angle insp ep) ma1 (- ea1 sa1))
- (if (< ma1 0) (setq ma1 (+ sa1 (/ (+ (* 2 pi) ma1) 2.0))) (setq ma1 (+ sa1 (/ ma1 2.0))))
- (setq sp1 (polar insp sa1 r1) ep1 (polar insp ea1 r1))
- (setq sp2 (polar insp sa1 r2) ep2 (polar insp ea1 r2))
- (setq mp1 (polar insp ma1 r1) mp2 (polar insp ma1 r2))
- (setq mp (polar mp2 (angle mp2 mp1) (/ (- r1 r2) 2.0)))
- (setvar "pickbox" 1)
- (setq sn1 (ssname (ssget mp1) 0))
- (setq sn2 (ssname (ssget mp2) 0))
- (setvar "pickbox" pib)
- (command "break" sn1 sp1 ep1)
- (command "break" sn2 sp2 ep2)
- (command "layer" "m" "pwindow" "")
- (command "line" sp1 sp2 "" "line" ep1 ep2 "")
- (command "color" 2)
- (setq dr (/ (- r1 r2) 3.0) r3 (+ r2 dr) r4 (- r1 dr))
- (setq sp3 (polar insp sa1 r3) ep3 (polar insp ea1 r3))
- (setq sp4 (polar insp sa1 r4) ep4 (polar insp ea1 r4))
- (if (= (substr (setq bn (nth 1 one)) 1 2) "CC") (progn
- (setq sn nil sn (ssadd))
- (command "arc" sp3 "c" insp ep3)
- (ssadd (entlast) sn)
- (command "arc" sp4 "c" insp ep4)
- (ssadd (entlast) sn)
- (command "arc" sp1 "c" insp ep1)
- (ssadd (entlast) sn)
- (command "arc" sp2 "c" insp ep2)
- (ssadd (entlast) sn)
- (setvar "aflags" 1)
- (command "attdef" "" "x" "" "" "s" "standard" mp1 (* 3 (getvar "userr1")) 0)
- (ssadd (entlast) sn)
- (command "attdef" "" "x1" "" "" mp1 (* 3 (getvar "userr1")) 0)
- (ssadd (entlast) sn)
- (setq bn (strcat "CCA" (rtos (car mp) 2 0) (rtos (cadr mp) 2 0)))
- (command "color" "bylayer")
- (command "block" bn mp sn "")
- (setq x (strcat wmes1 " " (itoa (fix (distance sp1 ep1))) " " (nth 3 one) " " whgt " " (itoa w)))
- (setq x1 (strcat wmes1 " " (rtos sa1 2 4) " " (rtos ea1 2 4) " " (rtos r1 2 4) " " (rtos r2 2 4) " " (nth 3 one) " " whgt " " (itoa w) " " (rtos (angle sp1 ep1) 2 4)))
- (command "insert" bn mp "XYZ" 1 1 1 0 x x1)
- ) ;endprogn "CC"
- (progn ;else
- (setq sn (entlast) ss nil ss (ssadd))
- (command "insert" bn mp (/ (distance sp3 ep3) 100.0) "" (/ (* (angle sp3 ep3) 180.0) pi) "")
- (command "explode" (entlast))
- (while (/= (setq sn (entnext sn)) nil) (ssadd sn ss))
- (setvar "aflags" 1)
- (command "attdef" "" "x1" "" "" mp1 (* 3 (getvar "userr1")) 0)
- (ssadd (entlast) ss)
- (setq bn (strcat "CCA" (rtos (car mp) 2 0) (rtos (cadr mp) 2 0)))
- (command "block" bn mp ss "")
- (setq x (strcat wmes1 " " (itoa (fix (distance sp1 ep1))) " " (nth 3 one) " 0 " (itoa w)))
- (setq x1 (strcat wmes1 " " (rtos sa1 2 4) " " (rtos ea1 2 4) " " (rtos r1 2 4) " " (rtos r2 2 4) " " (nth 3 one) " 0 " (itoa w) " " (rtos (angle sp1 ep1) 2 4)))
- (command "insert" bn mp "xyz" 1 1 0.01 0 x x1)
- )) ;endif
- (command "undo" "end")
- )) ;end cond
- )) ;endwhile endprogn
- (princ "*Not found*"))
- ) ;endif
- ) ;end cond
- ) ;end while
- (command "layer" "s" "0" "")
- (command "text" "s" "hz")
- (command)
- (setvar "cmdecho" 1)
- (setq *error* oer)
- (princ)
- )