home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Black Box 4
/
BlackBox.cdr
/
autocad
/
pop10.arj
/
SETUP.LSP
< prev
Wrap
Text File
|
1991-08-20
|
3KB
|
98 lines
;
;+-------------------------------------------------------------------------+
;| SETUP.LSP |
;| Ver. 1.0 Feb. 25, 1986 |
;| |
;| J.J.K. Feb. 25, 1986 |
;| |
;| C.L.H Nov. 29, 1987 Added error routine and input checking. |
;| |
;| M.D.F. Jul. 2, 1990 Modified for use with the pop10 menus. |
;| |
;| This program will set the Units and Limits of a new drawing, and will |
;| draw a border line around the drawing. |
;+-------------------------------------------------------------------------+
;
;
(vmon)
(defun seterr (s) ;define an error handler
(if (/= s "Function cancelled")
(princ (strcat "\nError: " s))
)
(menucmd "P10=P10S")
(setvar "cmdecho" oce) ;restore previous cmdecho value
(setvar "lunits" olu) ;restore previous linear units value
(setq *error* oer ;restore previous error handler
seterr nil )
(princ)
)
(apply '(lambda (/ a b d cx cy xl yl oer olu oce)
(menucmd "P10=*")
(setq oce (getvar "cmdecho")) ;store current cmdecho value
(setvar "cmdecho" 0) ;turn cmdecho off
(setq oer *error* ;store AutoLisp error routine
*error* seterr) ;temporarily replace it
(initget (+ 1 2 4)) ;no null input, negative or zero values
(setq a (getint "\nSelect the Units from the screen menu: "))
(menucmd (strcat "P10=P10U" (itoa a)))
(menucmd "P10=*")
(cond
((= a 5)
(setq a 2 d 5)
)
)
(setq olu (getvar "lunits")) ;store current linear units setting
(command ".setvar" "lunits" a) ;set linear units to new value
(initget (+ 1 4)) ;0 ok, but no null or negative values
(setq b (getreal "\nSelect the Scale from the screen menu: "))
(cond
(
(= b 0)
(progn
(initget (+ 1 2 4))
(setq b (getreal "\nEnter the scale: "))
(setq b (float b))
)
)
)
(cond
(
(= d 5)
(menucmd "P10=P10METRIC")
(menucmd "P10=*")
)
(T
(menucmd "P10=P10ENGLISH")
(menucmd "P10=*")
)
)
(initget (+ 1 4))
(setq cx (getdist "\nSelect the Paper size from the screen menu: "))
(initget (+ 1 4))
(setq cy (getdist))
(cond
(
(= cx 0)
(initget (+ 1 2 4))
(setq cx (getdist "\nEnter the Horizontal Dimension of the paper: "))
(initget (+ 1 2 4))
(setq cy (getdist "\nEnter the Vertical Dimension of the paper: "))
)
)
(setq xl (* b cx) yl (* b cy))
(command ".limits" "0,0" (list xl yl)
".insert" "border" "0,0" xl yl "0"
".zoom" "a"
)
(menucmd "P10=P10S")
(menucmd "P10=*")
(setvar "cmdecho" oce) ;restore previous value for cmdecho
(setq *error* oer ;restore previous error handler
seterr nil )
(princ)
)
'()
)