home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Share Gallery 1
/
share_gal_1.zip
/
share_gal_1
/
GR
/
GR505.ZIP
/
LSP.EXE
/
SM.LSP
< prev
next >
Wrap
Text File
|
1989-01-28
|
971b
|
32 lines
(defun C:SM ()
; variable set-up
(setvar "CMDECHO" 0)
(setq lun (getvar "LUNITS"))
(setq lup (getvar "LUPREC"))
(setq us "%%U")
(setq dd "DONE")
; input requirements
(setq cf
(getstring "\n Converting Standard to Metric ? < Y or N > : "))
(setq cf (strcase cf))
(if (or (= cf "Y") (= cf "N"))
(setq dp
(getint (strcat "\n Decimal Points ? < "(itoa lup)" > : ")))
(c:sm))
; function call to convert standard to metric
(setq a (ssget))
(setq n (sslength a))
(setq index 0)
(repeat n
(setq b1 (entget (ssname a index)))
(setq index (1+ index))
(setq c (assoc 1 b1))
(if (= cf "Y")
(setq d (cons (car c) (* (atof(cdr c)) 25.4)))
(setq d (cons (car c) (/ (atof(cdr c)) 25.4))))
(setq d1 (cons (car d) (rtos(cdr d)2 dp)))
(setq b2 (subst d1 c b1))
(entmod b2)
)
(eval dd)
)