- UID
- 207259
- 积分
- 56
- 精华
- 贡献
-
- 威望
-
- 活跃度
-
- D豆
-
- 在线时间
- 小时
- 注册时间
- 2004-12-30
- 最后登录
- 1970-1-1
|
马上注册,结交更多好友,享用更多功能,让你轻松玩转社区。
您需要 登录 才可以下载或查看,没有账号?立即注册
×
给定一点,在引出线上给出序号,并按顺序递增.
[pcode=lisp,true]
(defun mx_dialog ()
(setq dcl_id (load_dialog "XL_TuBiaoTuKuang.dcl"))
(if (not (new_dialog "minxibiao" dcl_id))
(exit)
) ;_ 结束if
(mode_tile "mx_diahao1" 2)
(set_tile "mx_xuhao1" xuhao)
(set_tile "mx_diahao1" "")
(set_tile "mx_name1" "")
(set_tile "mx_shuliang1" "")
(set_tile "mx_cailiao1" "")
(set_tile "mx_beizu1" "")
(action_tile
"ch_xuhao"
(strcat
"(mode_tile \"mx_xuhao1\" 0)"
"(mode_tile \"mx_xuhao1\" 2)"
) ;_ 结束strcat
) ;_ 结束action_tile
(action_tile
"nch_xuhao"
(strcat
"(mode_tile \"mx_xuhao1\" 1)"
"(mode_tile \"mx_diahao1\" 2)"
) ;_ 结束strcat
) ;_ 结束action_tile
(action_tile
"accept"
(strcat
"(setq xuhao (get_tile \"mx_xuhao1\"))"
"(setq diahao (get_tile \"mx_diahao1\"))"
"(setq name (get_tile \"mx_name1\"))"
"(setq shuliang (get_tile \"mx_shuliang1\"))"
"(setq cailiao (get_tile \"mx_cailiao1\"))"
"(setq beizu (get_tile \"mx_beizu1\"))"
"(done_dialog)"
) ;_ 结束strcat
) ;_ 结束action_tile
(start_dialog)
(unload_dialog dcl_id)
) ;defun mx_dialog
;;====================================================
(defun c:emxb (/ scmde oldosm xuhao file ycp ycp2 ycp3 textp dcl_id)
(setq scmde (getvar "cmdecho"))
(setq oldosm (getvar "osmode"))
(setvar "cmdecho" 0)
(setq file (open (strcat (getenv "temp") "\\mxb.txt") "w"))
(close file)
(setq xuhao "1")
(while
(setq ycp (getpoint "\n引出点:"))
(command "line" ycp pause "")
(setq ycp2 (getvar "lastpoint"))
(if (> (car ycp2) (car ycp))
(progn
(setq ycp3 (list (+ (car ycp2) 8) (cadr ycp2)))
(setq
textp (list (- (car ycp3) 4)
(+ (cadr ycp3) (+ (/ (getvar "textsize") 2) 1))
) ;_ 结束list
) ;_ 结束setq
) ;_ 结束progn
(progn
(setq ycp3 (list (- (car ycp2) 8) (cadr ycp2)))
(setq
textp (list (+ (car ycp3) 4)
(+ (cadr ycp3) (+ (/ (getvar "textsize") 2) 1))
) ;_ 结束list
) ;_ 结束setq
) ;_ 结束progn
) ;_ 结束if
(setvar "osmode" 0)
(command "line" ycp2 ycp3 "")
(mx_dialog)
(command "text"
"j"
"mc"
textp
(getvar "textsize")
"0"
xuhao
) ;_ 结束command
(setvar "osmode" oldosm)
(setq file (open (strcat (getenv "temp") "\\mxb.txt") "a"))
(write-line
(strcat "\042" xuhao "\042" "\042" diahao
"\042" "\042" name "\042" "\042"
shuliang "\042" "\042" cailiao "\042"
"\042" beizu "\042"
) ;_ 结束strcat
file
) ;_ 结束write-line
(close file)
(setq xuhao (itoa (+ (atoi xuhao) 1)))
(setvar "orthomode" 0)
) ;while
(setvar "cmdecho" scmde)
(princ)
) ;defun c:emxb
;;;=======================================================
;;;以下是DCL程序文件.
minxibiao : dialog {
label = "明细表设置";
: boxed_radio_row {
label="编辑序号";
: radio_button {
label = "修改序号";
key = "ch_xuhao";
}
: radio_button {
label = "不修改序号";
key = "nch_xuhao";
value = "1";
}
}
: boxed_column {
label="填写明细表";
: edit_box {
label = "序号:";
key = "mx_xuhao1";
edit_width = 25;
is_enabled =false;
}
: edit_box {
label = "代号:";
key = "mx_diahao1";
edit_width = 25;
}
: edit_box {
label = "名称:";
key = "mx_name1";
edit_width = 25;
}
: edit_box {
label = "数量:";
key = "mx_shuliang1";
edit_width = 25;
}
: edit_box {
label = "材料:";
key = "mx_cailiao1";
edit_width = 25;
}
: edit_box {
label = "备注:";
key = "mx_beizu1";
edit_width = 25;
}
}
: row {
: spacer { width = 1;}
ok_only;
: spacer { width = 1;}
}
}[/pcode]
|
|