图库缩略图
请教大神指点缩略图文图,图库卡在缩略图上了码发上来,不然人家怎么帮你? http://bbs.mjtd.com/thread-184800-1-1.html
建议试试这个。 本帖最后由 自贡黄明儒 于 2022-9-8 07:49 编辑
(defun C:tt2 (/ dcl-image dialog do1 setdataDCLID FILELST FNAME I IMGTXT KEY RETURN#)
(defun dcl-image (key x y file)
(start_image key)
(setq max_x (dimx_tile key)
max_y (dimy_tile key)
)
(slide_image
x
y
(- max_x x)
(- max_y y)
file
)
(end_image)
)
(defun dialog (/ FN I II)
(setq i -1)
(setq fname (vl-filename-mktemp nil nil ".dcl"))
(setq fn (open fname "w"))
(write-line
"tempDlg_1:dialog{label=\"PAi_Symbols图块\";spacer_1;"
fn
)
(repeat 4
(write-line " :row{" fn)
(setq ii i)
(repeat 8
(setq ii (1+ ii))
(write-line (strcat " :image_button{color=-2; width=16; aspect_ratio=0.66; key=\"Imgkey" (itoa ii) "\";allow_accept = true;}") fn)
)
(write-line " }" fn)
(write-line " :row{" fn)
(repeat 8
(setq i (1+ i))
(write-line (strcat " :text{label=\"Text\";key=\"Txtkey" (itoa i) "\";allow_accept = true;}") fn)
)
(write-line " }" fn)
)
(write-line " :row{ok_cancel_help;}" fn)
(write-line " }" fn)
(close fn)
;;(startapp "notepad" fname)
)
;;fileLst库文件列表
(defun setdata ()
(setq i -1)
(mapcar (function
(lambda (x y)
(setq i (1+ i))
(set_tile (strcat "Txtkey" (itoa i)) x)
(dcl-image (strcat "Imgkey" (itoa i)) 0 0 y)
)
)
ImgTxt
fileLst
)
)
;;在这里,用根据key做不同的事情
(defun do1 ()
(cond ((equal key "Imgkey1") (alert key))
((equal key "Imgkey2") (alert key))
((equal key "Imgkey3") (alert key))
((equal key "Imgkey4") (alert key))
)
)
(setq ImgTxt
'("指北针" "入户标志" "区域名称" "区域编号"
"区域指示" "材料索引" "物料索引" "立面索引"
"剖面索引" "剖面索引" "剖面索引"
"详图索引" "铺贴起始" "铺贴倾斜" "特殊符号"
"总图标高" "平面标高" "立面标高" "详图标高"
"引注标高" "" "" ""
"" "" "" ""
"" "" "" ""
""
)
)
(setq fileLst (list "steelsec(1001eas)"
"steelsec(1002uas)"
"steelsec(1003gbgzgs)"
"steelsec(1004ybgzgs)"
"steelsec(1005gbchans)"
"steelsec(1006ybchans)"
"steelsec(1007chs)"
"steelsec(1008shs)" ""
"" "" ""
"" "" ""
"" "" ""
"" "" ""
"" "" ""
"" "" ""
"" "" ""
"" ""
)
)
(dialog)
(setq dclid (load_dialog fname))
(new_dialog "tempDlg_1" dclid)
(setdata)
(mapcar (function
(lambda (x)
(action_tile (strcat "Imgkey" (itoa x)) "(setq key $key)")
)
)
(list 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31)
)
(action_tile (strcat "Imgkey" (itoa 0)) "(setq key $key)")
(action_tile "accept" "(done_dialog 1)")
(setq return# (start_dialog))
(unload_dialog dclid)
(vl-file-delete fname)
(if (equal return# 1)
(do1)
)
(princ)
)
这个好,谢谢分享! 自贡黄明儒 发表于 2022-9-8 07:42
这个咋用呀 使用这个Slide控件 utopio 发表于 2022-10-12 18:06
使用这个Slide控件
大哥 这个咋用》
页:
[1]