home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Share Gallery 1
/
share_gal_1.zip
/
share_gal_1
/
GR
/
GR506.ZIP
/
ACAD2.EXE
/
SM.DOC
< prev
next >
Wrap
Text File
|
1989-01-28
|
2KB
|
54 lines
; *****************************************************************
;
; SM.LSP
;
; Author: Paul Nance
; Home: (919)-226-3648
; Compuserve: [73627,1733]
;
; Function Description
; -------------------------------------------------------------
; C:SM This routine will convert standard or metric
; numerical text to its counterpart.
; The routine will prompt for converting from
; Standard to Metric (Yes or No), then prompt
; for number of decimals to the right of tne decimal
; point.
; The standard AutoCAD functions Window, Crossing,
; or Selection can be used.
;
; Note: Allowance is not made for lines, circles, or
; poly-lines.
;
; Variable set-up
(defun c:SM ()
(setvar "CMDECHO" 0)
(setq lun (getvar "LUNITS"))
(setq lup (getvar "LUPREC"))
(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)
)