谢谢Lee Mac占用您的时间,但您能告诉我以下代码出了什么问题吗
- (defun c:pset ()
- (if
- (and
- (setq tmp (vl-filename-mktemp nil nil ".dcl"))
- (setq des (open tmp "w"))
- (foreach line
- '(
- "img : image_button { width = 6; aspect_ratio = 1; fixed_width = true; fixed_height = true; }"
- "col : dialog { label = "Image Button Test";"
- " : row"
- " {"
- " : img { key = "b1"; }"
- " : img { key = "b2"; }"
- " }"
- " : button { label = "OK"; width = 6; key = "accept"; }"
- " : button { label = "Cancel"; width = 6; key = "cancel"; is_cancel = true; }"
- "}"
- )
- (write-line line des)
- )
- (not (setq des (close des)))
- (< 0 (setq dcl (load_dialog tmp)))
- (new_dialog "col" dcl)
- )
- (progn
- (setq col 0)
- (foreach key '("b1" "b2")
- (_fill_image key col)
- (action_tile
- key
- (strcat "(_fill_image "b1" " (substr key 2) ")")
- )
- (action_tile
- key
- (strcat "(_fill_image "b2" " (substr key 2) ")")
- )
- )
- (start_dialog)
- )
- (princ "\nError Loading Dialog.")
- )
- (if (< 0 dcl)
- (setq dcl (unload_dialog dcl))
- )
- (if (findfile tmp)
- (vl-file-delete tmp)
- )
- (princ)
- )
- (defun _fill_image ()
- (start_image key)
- (fill_image 0 0 (dimx_tile key) (dimy_tile key) col)
- (end_image)
- )
- (princ)
正如我之前所说,我想将acad\u colordlg函数分配给按钮,但我不断得到以下错误“参数太多”!
顺便说一句,很好的应用程序。。。我冒昧地复制并修改了它!我想做的是当我按下图像按钮加载acad_colordlg时,在我选择颜色后,图像按钮会将其颜色更改为我选择的颜色!到目前为止,我做到了这一点。。。同时加载对话框和颜色对话框,选择颜色,然后按钮将其颜色更改为所选颜色。。。现在,无论我按多少次图像按钮,颜色对话框都不会出现!
关于Csaba Arpad Dobai! |