home *** CD-ROM | disk | FTP | other *** search
- (vmon)
-
- (defun sanerr(s)
- (if (/= s "Function cancelled")
- (princ (strcat "\nError:" s))
- )
- (command "layer" "s" "0" "")
- (setvar "cmdecho" 1)
- (setvar "osmode" 0)
- (setq *error* oer)
- (princ)
- )
-
- (defun C:SAN(/ x oer loop sp ep pl pl1 p ssw sn sn1 sn2 en ang l n)
- (setvar "cmdecho" 0)
- (setq oer *error* *error* sanerr)
- (princ "\n╔ó╦«┐φ╢╚ <500>:")
- (setq x (getint))
- (if (/= x nil) (setq ssw x) (setq ssw 500))
- (graphscr)
- (setq loop t)
- (while loop
- (initget "ON OFF")
- (setq sp (getpoint "\n╢╦╡πON/OFF/<╔ó╦«╞≡╡π>:"))
- (cond ((= sp "ON") (setvar "osmode" 1))
- ((= sp "OFF") (setvar "osmode" 0))
- (t (setq loop nil))
- ))
- (setq pl nil pl (cons sp pl))
- (while sp
- (initget "Undo")
- (setq ep (getpoint sp "\n╗╪═╦U/<╧┬╥╗╡π>:"))
- (if (= ep "Undo") (if (> (length pl) 1) (setq pl (cdr pl) sp (car pl)) (princ "*╗╪═╦═Ω┴╦*"))
- (if (/= ep nil) (setq pl (cons ep pl) sp ep) (setq sp ep))
- )
- )
- (setq pl (reverse pl) sp (nth 0 pl) n 1)
- (setvar "osmode" 0)
- (command "layer" "m" "pother" "")
- (command "pline" sp "w" "0" "")
- (repeat (- (length pl) 1)
- (command (nth n pl))
- (setq n (1+ n))
- )
- (command)
- (setq sn (entlast))
- (setq ep (nth 1 pl) ang (angle sp ep) p (polar sp (- ang 1.57079) ssw))
- (command "offset" "t" (list sn sp) p "")
- (setq sn1 (entlast))
- (setq sn2 (entnext sn1) pl1 nil)
- (while (/= "SEQEND" (cdr (assoc 0 (setq en (entget sn2)))))
- (setq ep (cdr (assoc 10 en)) pl1 (cons ep pl1))
- (setq sn2 (entnext sn2))
- )
- (setq pl1 (reverse pl1) l (length pl) n 0)
- (repeat l
- (command "pline" (nth n pl) (nth n pl1) "")
- (setq n (1+ n))
- )
- (command "layer" "s" "0" "")
- (setvar "cmdecho" 1)
- (setvar "osmode" 0)
- (setq *error* oer)
- (princ)
- )