home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Current Shareware 1994 January
/
SHAR194.ISO
/
cad_util
/
v8n8_cad.zip
/
TXTIN2.LSP
< prev
Wrap
Lisp/Scheme
|
1993-07-23
|
1KB
|
45 lines
(defun C:txtin (/ fln sty pt1 hgt rot f e txt)
(setq fln (getstring "\nFile name to import "))
(setq sty (getstring "\nSTYLE name or <ENTER> to keep style "))
(setq pt1 (getpoint "\nPick text beginning point"))
(setq hgt (getdist pt1 "\nHeight or <ENTER> if fixed height"))
(setq rot (getangle pt1 "\nText rotation "))
(if (= rot nil)(setq rot 0))
(setq rot (rtd rot))
(setq f (open fln "r"))
(if (/= sty "") (command "text" "style" sty ^c))
(setq txt (read-line f))
(if (= hgt nil) (command "text" pt1 rot txt))
(if (/= hgt nil) (command "text" pt1 hgt rot txt))
(setq e 1)
(while e
(setq txt (read-line f))
(if (= txt nil) (setq e nil))
(command "text" "" txt)
)
(close f)
)
(defun rtd (a)
(/ (* a 180.0) pi))
(defun C:txtout (/ fln f a n index e1 e txt)
(setq fln (getstring "\nFile name: "))
(setq f (open fln "w"))
(setq a (ssget))
(setq n (sslength a))
(setq index (- n 1))
(repeat n
(setq e1 (entget (ssname a index)))
(setq index (- index 1))
(setq e (assoc 0 e1))
(if (= "TEXT" (cdr e))
(progn
(setq txt (cdr (assoc 1 e1)))
(write-line txt f)
)
)
)
(close f)
)