home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
BUG 15
/
BUGCD1998_06.ISO
/
aplic
/
felixcad
/
fcaddata.z
/
QTEXT.LSP
< prev
next >
Wrap
Lisp/Scheme
|
1996-09-23
|
3KB
|
66 lines
;;; QTEXT.LSP
;;; ======================================================================
;;; Text Utilility QTEXT. Quick text by selecting reference text.
;;; Provided by Felix Computer Aided Technologies GmbH 1996 as Lisp Sample
;;; ======================================================================
(defun C:QTEXT( / e1 f1 el1 el2 ep1 p1 s1 t_height t_value t_angle
tmp_cmdecho)
(defun text_error(s1)
(setvar "CMDECHO" tmp_cmdecho)
(if (= s1 "User break")
(if f1 (progn (entdel (entlast))(redraw e1 1)) )
(princ (strcat "\n*** " s1 " ***"))
)
(setq *error* nil f1 nil e1 nil)
(princ)
)
(setq *error* text_error)
(if (entlast)
(progn
(while (not (setq ep1 (entsel "Select reference text: "))))
(setq f1 nil e1 (car ep1) el1 (entget e1))
(if (= (cdr (assoc 0 el1)) "TEXT")
(progn
(setq
t_height (rtos (cdr (assoc 40 el1)) 2 -1)
t_angle (angtos (cdr (assoc 50 el1)) 0 -1)
t_value (cdr (assoc 1 el1))
)
(setq s1 (getstring 0 (strcat "New text <" t_value ">: ")))
(if (= s1 "") (setq s1 t_value))
(if s1 (progn
(setq f1 T el2 (entmake (subst (cons 1 s1) (assoc 1 el1) el1)))
(setq p1 (cdr (assoc 10 el2)))
(setq tmp_cmdecho (getvar "CMDECHO"))
(setvar "CMDECHO" 0)
(princ "Text insertion point: ")
(command ".MOVE" (entlast) "" p1)
(redraw e1 1)
(setq p1 (getvar "LASTPOINT"))
(princ (strcat "\nCurrent text height: " t_height))
(princ "\nScale factor <1.00>: ")
(command ".SCALE" (entlast) "" p1 "_R" t_height)
(princ (strcat "\nCurrent text insertion angle: " t_angle))
(princ "\nText angle: ")
(command ".ROTATE" (entlast) "" p1 "_R" t_angle)
(setvar "CMDECHO" tmp_cmdecho)
))
)
(alert
"No text selected!"
"Alert"
"EXCLAMATION"
)
)
)
(princ "No entity in drawing!")
)
(setq *error* nil)
(princ)
)
;;; =================================================================
(princ)