程序:- (defun c:pw ()
- (setvar "osmode" 0)
- (setvar "cmdecho" 0)
- (setvar "TEXTEVAL" 1)
- (SETQ base (getpoint "指定文字左上角位置\n"))
- (IF (> (SETQ DCL_ID (LOAD_DIALOG "bhsr")) 0)
- (IF (NEW_DIALOG "bhsr" DCL_ID "") (PROGN
- (action_tile "accept" "(GETVALOFDIA) (DONE_DIALOG 1)")
- (action_tile "cancel" "(DONE_DIALOG 0)")
- (SETQ RE (START_DIALOG))
- ) (PROGN
- (ALERT "Unable to display dialog box!\n无法显示对话框!")
- (UNLOAD_DIALOG DCL_ID)
- ))
- (ALERT "Unable to load dialog box!\n无法装载对话框!")
- )
- (IF (= RE 1) (PROGN
- (command "text" "j" "tr" base "2.5" "0" txt0)
- (setq en0 (entlast))
- (setq en (entget en0))
- (setq p00 (list (cadr (assoc 10 en)) (caddr (assoc 10 en))))
- (setq L (abs (- (cadr (assoc 11 en)) (cadr (assoc 10 en)))))
- (command "move" en0 "" p00 base)
- (setq base (mapcar '- base '(0.0 1.0)))
- (setq base1 (polar base 0 L))
- (command "line" base base1 "")
- (setq base (mapcar '+ base '(0.0 -2.15)))
- (command "TEXT" "j" "ml" base "2.5" "0" txt1)
- ))
- (setvar "cmdecho" 1)
- (setvar "osmode" 37)
- (princ)
- )
- (DEFUN GETVALOFDIA ()
- (SETQ txt0 (READ (GET_TILE "kthd"))
- txt1 (READ (GET_TILE "ktpw")))
- )
对话框:- dcl_settings : default_dcl_settings { audit_level = 3; }
- bhsr : dialog {
- key = "cs" ;
- label = "钻孔编号输入" ;
- : column {
- : edit_box { key="kthd"; label="请输入矿体厚度"; value="";}
- : edit_box { key="ktpw"; label="请输入矿体品位"; value="";}
- }
- ok_cancel ;
- }
|