home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
BUG 15
/
BUGCD1998_06.ISO
/
aplic
/
felixcad
/
fcaddata.z
/
FLX_RTXT.LSP
< prev
next >
Wrap
Lisp/Scheme
|
1996-09-30
|
3KB
|
92 lines
;;; FLX_RTXT.LSP
;;; =========================================================
;;; Provided for FelixCAD
;;; =========================================================
(defun FLX_RTEXT( / TEDIT_INIT prt_list el1 el2 ep1 p1
s1 fl e1 t_widthfac t_height t_font
t_value t_angle tmp_cmdecho)
;;; Error Handler
(FLX_FUNC_INIT)
;;; Prompt List
(setq prt_list (list
"Select reference text: "
"Insertion point: "
"No text selected!"
"Reference Text"
"No entity in drawing!"
"Alert"
))
(if FLX_XLANGUAGE (FLX_XLANGUAGE "_rtxt" nil))
;;; Dialog Initialization Function
(defun TEDIT_INIT( / n)
(if FLX$WIN95 (foreach n
'("IDCANCEL" "IDOK" "IDHELP" "Edit1" "Font" "Height" "WidthFactor"
"Angle" "Static1" "Static2" "Static3" "Static4")
(Dlg_TileSetFont n 2)
))
(Dlg_TileSet "Font" t_font)
(Dlg_TileSet "Height" t_height)
(Dlg_TileSet "WidthFactor" t_widthfac)
(Dlg_TileSet "Angle" t_angle)
(Dlg_TileSet "Edit1" t_value)
(Dlg_TileMode "Edit1" 3) ;;; overwrite mode !
(Dlg_TileAction "Edit1" "(setq s1 (Dlg_TileGet \"Edit1\"))(Dlg_DialogDone)")
(Dlg_TileAction "IDOK" "(setq s1 (Dlg_TileGet \"Edit1\"))(Dlg_DialogDone)")
(Dlg_TileAction "IDCANCEL" "(setq s1 nil)(Dlg_DialogDone)")
)
(if (entlast)
(progn
(while (not (setq ep1 (entsel (nth 0 prt_list)))))
;;;@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)) -1 -1)
t_angle (angtos (cdr (assoc 50 el1)) -1 -1)
t_widthfac (rtos (cdr (assoc 41 el1)) 2 2)
t_font (cdr (assoc 7 el1))
t_value (cdr (assoc 1 el1))
)
(if (FLX_DLGDSP "flx_dlg" "RTEXT" "(princ)" "(TEDIT_INIT)")
(princ)
(exit)
)
(if s1 (progn
(setq f1 T)
(setq 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 (nth 1 prt_list)) ;;;@Insertion point:
(command ".MOVE" (entlast) "" p1)
(redraw e1 1)
(setvar "CMDECHO" tmp_cmdecho)
))
)
(alert
(nth 2 prt_list) ;;;@No text selected !
(nth 3 prt_list) ;;;@Reference Text
"EXCLAMATION"
)
)
)
(alert
(nth 4 prt_list) ;;;@No entity in drawing !
(nth 5 prt_list) ;;;@Alert
"EXCLAMATION"
)
)
(FLX_FUNC_EXIT) (setq *error* nil)
(princ)
)
(princ)