明经CAD社区

 找回密码
 注册

QQ登录

只需一步,快速开始

搜索
查看: 1023|回复: 2

[求助]颜色无法更新,请高手们指点!

[复制链接]
发表于 2009-6-30 19:43:00 | 显示全部楼层 |阅读模式

大家好,我的一个程序需要修改图层颜色,我建了一个影像按钮元件并关联到CAD的标准颜色对话框

可是一个问题困扰了我几天了:

当我按下这个影像按钮元件,并选择了一个颜色,点击“确定”结束CAD的标准颜色对话框后,影像按钮元件显示的颜色无任何动静。。。。。。

我想要的效果是:按下这个影像按钮元件,并选择了一个颜色,点击“确定”结束CAD的标准颜色对话框后,影像按钮元件显示的颜色立马更新,变成我所选择的颜色!!!!!

高手们,能否指导一下,问题出在哪了,不胜感激!!!

附上代码如下:

dcl:


层色设置:dialog {
    label = "层色设置" ;
    :row {
        :edit_box {
            key = "tc1-ed" ;
            width = 9 ;
            edit_width = 9 ;
            fixed_width = true ;
            edit_limit = 5 ;
            value = "图层名" ;
        }
        :image_button {
            label = "Abuot" ;
            key = "ys1-bu" ;
            height = 2 ;
            width = 4 ;
            fixed_width = true ;
            fixed_height = true ;
        }
    }
    :button {
        key = "cancel" ;
        label = "退出" ;
        is_cancel = true ;
        fixed_width = true ;
        alignment = centered ;
    }
}

lsp:

(defun c:cssz ()
  (setq dcl_id (load_dialog "层色设置.DCL"))
  (new_dialog "层色设置" dcl_id)
  (action_tile "ys1-bu" "(setq cssz_cs (acad_colordlg 1))")
  (if (not cssz_cs)
    (setq cssz_cs 1)
  )
  (start_image "ys1-bu")
  (fill_image 0 0 (dimx_tile "ys1-bu") (dimx_tile "ys1-bu") cssz_cs)
  (end_image)
  (start_dialog)
  (unload_dialog dcl_id)
)


发表于 2009-6-30 20:30:00 | 显示全部楼层
(defun c:cssz ()
 (defun act-ys1-bu()
   (setq cssz_cs (acad_colordlg 1))
   (if (not cssz_cs)    (setq cssz_cs 1)  )
   (start_image "ys1-bu")
   (fill_image 0 0 (dimx_tile "ys1-bu") (dimx_tile "ys1-bu") cssz_cs)
   (end_image)
 )
  (setq dcl_id (load_dialog "层色设置.DCL"))
  (new_dialog "层色设置" dcl_id)
  (action_tile "ys1-bu" "(act-ys1-bu)") 
  (start_dialog) 
  (unload_dialog dcl_id)
)
 楼主| 发表于 2009-7-1 08:52:00 | 显示全部楼层
已解决,多谢 xshrimp  热心指导    非常感谢!!!!
您需要登录后才可以回帖 登录 | 注册

本版积分规则

小黑屋|手机版|CAD论坛|CAD教程|CAD下载|联系我们|关于明经|明经通道 ( 粤ICP备05003914号 )  
©2000-2023 明经通道 版权所有 本站代码,在未取得本站及作者授权的情况下,不得用于商业用途

GMT+8, 2024-10-2 15:20 , Processed in 0.164430 second(s), 25 queries , Gzip On.

Powered by Discuz! X3.4

Copyright © 2001-2021, Tencent Cloud.

快速回复 返回顶部 返回列表