home *** CD-ROM | disk | FTP | other *** search
- (defun plverr(s)
- (if (/= s "Function cancelled")
- (princ (strcat "\nError:" s))
- )
- (command "layer" "s" "0" "")
- (setvar "cmdecho" 1)
- (setq *error* oer)
- (princ)
- )
- (defun C:PBANLV(/ oer x insp insn ss wl hl ssl sn en sn1 en1 ins hgt n n1 xx ymin base insh)
- (setvar "CMDECHO" 0)
- (setq oer *error* *error* plverr)
- ; (initget "Right Left")
- ; (setq fg (getkword "\n╤í╘±▒Ω╘┌╫≤▒▀,╙╥▒▀ (Left or Right):"))
- ; (if (= fg "Right") (setq fg "R") (setq fg "L"))
- (princ "\n╡┌╥╗╕÷┬Ñ░σ╕▀╢╚ <")
- (princ 3300)
- (setq wdh (if (setq x (getreal ">:")) x 3300))
- (setq insp (getpoint "\n▒Ω╕▀╖√║┼▓σ╚δ╡π:"))
- (command "layer" "m" "sdim" "")
- (setq ss (ssget) wl nil hl nil)
- (if ss (progn
- (setq ssl (sslength ss) n 0 n1 0)
- (repeat ssl
- (setq sn (ssname ss n) en (entget sn))
- (if (and (= "POLYLINE" (cdr (assoc 0 en))) (= "SBAN1" (cdr (assoc 8 en))))
- (progn
- (setq sn1 (entnext sn) en1 (entget sn1))
- (setq rn (cdr (assoc 10 en1)) ww nil)
- (setq ins (cdr (assoc 10 en1)))
- (setq wl (cons (list (cadr ins) n1) wl))
- (setq n1 (1+ n1))
- )) ;if
- (setq n (1+ n))
- )
- (setq n 0)
- (repeat (length wl)
- (setq ymin (apply 'min (mapcar 'car wl)))
- (setq x (assoc ymin wl))
- (if (= n 0) (setq base (- ymin wdh)))
- (setq wl (subst (list 1000000.0 0) x wl))
- (setq ins (list (car insp) ymin))
- (command "insert" (strcat "ELUR") ins (/ (getvar "USERR1") 100.0) "" "0" (rtos (/ (fix (+ 0.005 (- (cadr ins) base))) 1000.0) 2 3))
- (setq n (1+ n))
- )
- ))
- (command "layer" "s" "0" "")
- (setvar "CMDECHO" 1)
- (setq *error* oer)
- (princ)
- )