明经CAD社区

 找回密码
 注册

QQ登录

只需一步,快速开始

搜索
查看: 2244|回复: 12

[已解答] 这个地址该如何改?

[复制链接]
发表于 2014-7-31 08:17 | 显示全部楼层 |阅读模式
本帖最后由 lucas_3333 于 2014-7-31 08:47 编辑

请教大师们,这个对话框,指定SLD文件位置用的绝对位置,
  1. (strcat "E:\\Program Files\\AutoCAD 2010\\Support\\test\\" a ".sld" )

为什么仍然显示不出幻灯片? 如果想要相对地址(只要sld放在支持路径下)那改如何改?


  1.   (if (null *fb_user*)
  2.     (setq *fb_user* (mapcar 'itoa '(1 0 1 0)))
  3.     ) ;_ end of if

  4. (defun fbdia (/ radio dcl_id path dcl)
  5.   (setq  radio '("radio1" "radio2" "radioA" "radioB" )
  6.   path  (getenv "temp")
  7.   )
  8.   
  9.   ('((f lst /)
  10.      (setq f (open f "w"))
  11.      (mapcar ''(($) (write-line $ f)) lst)
  12.      (close f)
  13.      (setq f nil)
  14.      )
  15.     (setq dcl (strcat path "\\tmp.dcl"))
  16.     '("icon_fbox_img : image {"
  17.       "        color                   = 0;"
  18.       "        width                   = 40;"
  19.       "        aspect_ratio            = 0.75;"
  20.       "        allow_accept            = true;"
  21.       "        fixed_height            = true;"
  22.       "        fixed_width             = true;"
  23.       "}"
  24.       ""
  25.       ""
  26.       "fbox: dialog {"
  27.       "\tlabel=\"Fillet Box settings\";"
  28.       "        key = \"dcl_title\";"
  29.       ""
  30.       ": paragraph{"
  31.       "        : text_part{"
  32.       "\tlabel =\"Choose options \";"
  33.       "\t//alignment = centered;"
  34.       "}"
  35.       "  }      "
  36.       "        :column {"
  37.       "                :row { "
  38.       "                    :column {"
  39.      
  40.       "                      :icon_fbox_img {key = \"SH-CENTRE\";}"
  41.       "                    }"
  42.       "                    :column {             "
  43.       
  44.       "                      :icon_fbox_img {key = \"SH-EDGE\";}"
  45.       "                    }"
  46.       "                 }"
  47.       "}"
  48.       " :column{fixed_width=true;//alignment=centered;"
  49.       " :boxed_radio_row{label=\"Draw method\";"
  50.       "\t:radio_button{label=\"Pick centre                                         \";key=\"radio1\";}//value=\"0\";"
  51.       "        :radio_button{label=\"Pick side                                       \";key=\"radio2\";}//value=\"1\""
  52.       "}"
  53.       "}"
  54.       "           :column {"
  55.       "                 :row { "
  56.       "                    :column {"
  57.       
  58.       "                      :icon_fbox_img {key = \"SH-P2P\";}"
  59.       "                    } "
  60.       "                    :column {"
  61.       
  62.       "                      :icon_fbox_img {key = \"SH-C2C\";}"
  63.       "                    }"
  64.       "                 } "
  65.       "        }"
  66.       "        "
  67.       "        spacer_1;"
  68.       " :column{fixed_width=true;//alignment=centered;"
  69.       " :boxed_radio_row{label=\"Mode\";"
  70.       "           :radio_button{label=\"A:Edge to Edge                                 \";key=\"radioA\";}//value=\"0\""
  71.       "           :radio_button{label=\"B:Radii to radii                               \";key=\"radioB\";}//value=\"1\";"
  72.       "           }"
  73.       "}"
  74.       "        :column{fixed_width=true;alignment=centered;"
  75.       "        : paragraph{"
  76.       "        : text_part{"
  77.       "\tlabel =\"Fillet box : hanhphuc 2014\";"
  78.       "\talignment = centered;"
  79.       "}"
  80.       "  }      "
  81.       "        :row {"
  82.       " \t  spacer_0;"
  83.       "           ok_cancel;"
  84.       "        }"
  85.       "}"
  86.       "}"
  87.       )
  88.     )

  89.   (setq dcl_id (load_dialog dcl))
  90.   (new_dialog "fbox" dcl_id)
  91.   (mapcar ''((a)
  92.        ('((i sld)
  93.     (setq x (dimx_tile i))
  94.     (setq y (dimy_tile i))
  95.     (start_image i)
  96.     (fill_image 0 0 x y -2)
  97.     (slide_image 0 0 x y sld)
  98.     (end_image)
  99.     )
  100.         a
  101.         (strcat "E:\\Program Files\\AutoCAD 2010\\Support\\test\\" a ".sld" )
  102.         )
  103.        )
  104.     sld
  105.     ) ;_ end of mapcar
  106.   
  107. (if
  108.    *fb_user*
  109.     (mapcar 'set_tile
  110.       radio
  111.       (setq *fb_user* (apply 'append
  112.            (list
  113.            (if (= *pos* "Centre")
  114.              '("1" "0")
  115.              '("0" "1")
  116.              ) ;_ end of if

  117.            (if (= *key* "A")
  118.              '("1" "0")
  119.              '("0" "1")
  120.              ) ;_ end of if
  121.            ) ;_ end of list
  122.            ) ;_ end of apply
  123.       ) ;_ end of setq
  124.       ) ;_ end of mapcar
  125.     ) ;_ end of if
  126.   
  127. (setq        
  128.        *fb_user*
  129.   (mapcar ''((k a b) (action_tile k (strcat "(setq " a " \"" b "\" )")))
  130.        radio
  131.        '("*pos*" "*pos*" "*key*" "*key*")
  132.        '("Centre" "Edge" "A" "B")
  133.        ) ;_ end of mapcar
  134.        ) ;_ end of setq

  135.   
  136.   (action_tile "accept" "(setq *fb_user* (mapcar 'get_tile radio))
  137.   (alert (strcat
  138.    \"\nmethod: \"*pos* \"\nmode: \" *key* \"\n\"(vl-princ-to-string *fb_user*)))(done_dialog)")

  139.   (start_dialog)
  140.   
  141.   (unload_dialog dcl_id)
  142.   (princ)
  143.   ) ;_ end of defun







本帖子中包含更多资源

您需要 登录 才可以下载或查看,没有账号?注册

x

点评

贴个对话框的界面  发表于 2014-7-31 08:24
"觉得好,就打赏"
还没有人打赏,支持一下
 楼主| 发表于 2014-7-31 08:48 | 显示全部楼层
对话框界面已上传
发表于 2014-7-31 09:25 | 显示全部楼层

本帖子中包含更多资源

您需要 登录 才可以下载或查看,没有账号?注册

x
 楼主| 发表于 2014-7-31 10:03 | 显示全部楼层
xyp1964 发表于 2014-7-31 09:25

谢谢院长,只是还是一样,看不到幻灯片

4个幻灯片与lisp都放在E:\Program Files\AutoCAD 2010\Support\test
且这个路径已经是CAD支持文件搜索路径 

为什么还不行呢? 难道跟驱动程序有关?

点评

代码太长,还是伪源码简洁  发表于 2014-7-31 11:47
发表于 2014-7-31 10:32 | 显示全部楼层
用:(command "vslide" (strcat "E:\\Program Files\\AutoCAD 2010\\Support\\test\\" a ".sld" ) )试试能不能放出来,确定是否是路径问题
发表于 2014-7-31 10:39 | 显示全部楼层
  1. (setq sld '("SH-CENTRE" "SH-EDGE" "SH-P2P" "SH-C2C"))

应该是 缺少这句
其次,这个SLD名字要对应。
 楼主| 发表于 2014-7-31 10:40 | 显示全部楼层
小菜123 发表于 2014-7-31 10:32
用:(command "vslide" (strcat "E:\\Program Files\\AutoCAD 2010\\Support\\test\\" a ".sld" ) )试试能不 ...

谢谢小菜, 我试了
(command "vslide" (strcat "E:\\Program Files\\AutoCAD
2010\\Support\\test\\" a ".sld" ) ) vslide
Enter name of slide file to view <C:\Documents and Settings\Administrator\My
Documents\Drawing1>: ; error: bad argument type: stringp nil
Enter name of slide file to view <C:\Documents and Settings\Administrator\My
Documents\Drawing1>: SH-P2P

输入幻灯片名后,可以预览到
 楼主| 发表于 2014-7-31 10:48 | 显示全部楼层
edata 发表于 2014-7-31 10:39
应该是 缺少这句
其次,这个SLD名字要对应。

谢谢E大,那这一句要放到哪儿呢?
发表于 2014-7-31 10:51 | 显示全部楼层
这句之前
因为mapcar需要调用sld变量了。
sld表内容和图形按钮控件key名相同,即幻灯片名和控件key相同。
  1. (mapcar ''((a)
  2.        ('((i sld)
  3.     (setq x (dimx_tile i))
  4.     (setq y (dimy_tile i))
  5.     (start_image i)
  6.     (fill_image 0 0 x y -2)
  7.     (slide_image 0 0 x y sld)
  8.     (end_image)
  9.     )
  10.         a
  11.         (strcat "E:\\Program Files\\AutoCAD 2010\\Support\\test\\" a ".sld" )
  12.         )
  13.        )
  14.     sld
  15.     ) ;_ end of mapcar

评分

参与人数 1明经币 +1 收起 理由
lucas_3333 + 1 很给力!

查看全部评分

 楼主| 发表于 2014-7-31 11:12 | 显示全部楼层
edata 发表于 2014-7-31 10:51
这句之前
因为mapcar需要调用sld变量了。
sld表内容和图形按钮控件key名相同,即幻灯片名和控件key相同。 ...

E大,太棒了,按你说的,一下就成功了!谢谢!
如果不用绝对地址,就不是就将(strcat "E:\\Program Files\\AutoCAD 2010\\Support\\test\\" a ".sld" )换成a ?
您需要登录后才可以回帖 登录 | 注册

本版积分规则

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

GMT+8, 2024-4-20 07:21 , Processed in 0.512330 second(s), 38 queries , Gzip On.

Powered by Discuz! X3.4

Copyright © 2001-2021, Tencent Cloud.

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