lucas_3333 发表于 2014-7-31 08:17:27

这个地址该如何改?

本帖最后由 lucas_3333 于 2014-7-31 08:47 编辑

请教大师们,这个对话框,指定SLD文件位置用的绝对位置,
(strcat "E:\\Program Files\\AutoCAD 2010\\Support\\test\\" a ".sld" )
为什么仍然显示不出幻灯片? 如果想要相对地址(只要sld放在支持路径下)那改如何改?


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

(defun fbdia (/ radio dcl_id path dcl)
(setqradio '("radio1" "radio2" "radioA" "radioB" )
path(getenv "temp")
)

('((f lst /)
   (setq f (open f "w"))
   (mapcar ''(($) (write-line $ f)) lst)
   (close f)
   (setq f nil)
   )
    (setq dcl (strcat path "\\tmp.dcl"))
    '("icon_fbox_img : image {"
      "      color                   = 0;"
      "      width                   = 40;"
      "      aspect_ratio            = 0.75;"
      "      allow_accept            = true;"
      "      fixed_height            = true;"
      "      fixed_width             = true;"
      "}"
      ""
      ""
      "fbox: dialog {"
      "\tlabel=\"Fillet Box settings\";"
      "      key = \"dcl_title\";"
      ""
      ": paragraph{"
      "      : text_part{"
      "\tlabel =\"Choose options \";"
      "\t//alignment = centered;"
      "}"
      "}      "
      "      :column {"
      "                :row { "
      "                  :column {"
   
      "                      :icon_fbox_img {key = \"SH-CENTRE\";}"
      "                  }"
      "                  :column {             "
      
      "                      :icon_fbox_img {key = \"SH-EDGE\";}"
      "                  }"
      "               }"
      "}"
      " :column{fixed_width=true;//alignment=centered;"
      " :boxed_radio_row{label=\"Draw method\";"
      "\t:radio_button{label=\"Pick centre                                       \";key=\"radio1\";}//value=\"0\";"
      "      :radio_button{label=\"Pick side                                       \";key=\"radio2\";}//value=\"1\""
      "}"
      "}"
      "         :column {"
      "               :row { "
      "                  :column {"
      
      "                      :icon_fbox_img {key = \"SH-P2P\";}"
      "                  } "
      "                  :column {"
      
      "                      :icon_fbox_img {key = \"SH-C2C\";}"
      "                  }"
      "               } "
      "      }"
      "      "
      "      spacer_1;"
      " :column{fixed_width=true;//alignment=centered;"
      " :boxed_radio_row{label=\"Mode\";"
      "         :radio_button{label=\"A:Edge to Edge                                 \";key=\"radioA\";}//value=\"0\""
      "         :radio_button{label=\"B:Radii to radii                               \";key=\"radioB\";}//value=\"1\";"
      "         }"
      "}"
      "      :column{fixed_width=true;alignment=centered;"
      "      : paragraph{"
      "      : text_part{"
      "\tlabel =\"Fillet box : hanhphuc 2014\";"
      "\talignment = centered;"
      "}"
      "}      "
      "      :row {"
      " \tspacer_0;"
      "         ok_cancel;"
      "      }"
      "}"
      "}"
      )
    )

(setq dcl_id (load_dialog dcl))
(new_dialog "fbox" dcl_id)
(mapcar ''((a)
       ('((i sld)
    (setq x (dimx_tile i))
    (setq y (dimy_tile i))
    (start_image i)
    (fill_image 0 0 x y -2)
    (slide_image 0 0 x y sld)
    (end_image)
    )
      a
      (strcat "E:\\Program Files\\AutoCAD 2010\\Support\\test\\" a ".sld" )
      )
       )
    sld
    ) ;_ end of mapcar

(if
   *fb_user*
    (mapcar 'set_tile
      radio
      (setq *fb_user* (apply 'append
         (list
         (if (= *pos* "Centre")
             '("1" "0")
             '("0" "1")
             ) ;_ end of if

         (if (= *key* "A")
             '("1" "0")
             '("0" "1")
             ) ;_ end of if
         ) ;_ end of list
         ) ;_ end of apply
      ) ;_ end of setq
      ) ;_ end of mapcar
    ) ;_ end of if

(setq      
       *fb_user*
(mapcar ''((k a b) (action_tile k (strcat "(setq " a " \"" b "\" )")))
       radio
       '("*pos*" "*pos*" "*key*" "*key*")
       '("Centre" "Edge" "A" "B")
       ) ;_ end of mapcar
       ) ;_ end of setq


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

(start_dialog)

(unload_dialog dcl_id)
(princ)
) ;_ end of defun






lucas_3333 发表于 2014-7-31 08:48:01

对话框界面已上传

xyp1964 发表于 2014-7-31 09:25:11


lucas_3333 发表于 2014-7-31 10:03:24

xyp1964 发表于 2014-7-31 09:25 static/image/common/back.gif


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

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

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

小菜123 发表于 2014-7-31 10:32:31

用:(command "vslide" (strcat "E:\\Program Files\\AutoCAD 2010\\Support\\test\\" a ".sld" ) )试试能不能放出来,确定是否是路径问题

edata 发表于 2014-7-31 10:39:27

(setq sld '("SH-CENTRE" "SH-EDGE" "SH-P2P" "SH-C2C"))
应该是 缺少这句
其次,这个SLD名字要对应。

lucas_3333 发表于 2014-7-31 10:40:09

小菜123 发表于 2014-7-31 10:32 static/image/common/back.gif
用:(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

输入幻灯片名后,可以预览到

lucas_3333 发表于 2014-7-31 10:48:10

edata 发表于 2014-7-31 10:39 static/image/common/back.gif
应该是 缺少这句
其次,这个SLD名字要对应。

谢谢E大,那这一句要放到哪儿呢?

edata 发表于 2014-7-31 10:51:59

这句之前
因为mapcar需要调用sld变量了。
sld表内容和图形按钮控件key名相同,即幻灯片名和控件key相同。
(mapcar ''((a)
       ('((i sld)
    (setq x (dimx_tile i))
    (setq y (dimy_tile i))
    (start_image i)
    (fill_image 0 0 x y -2)
    (slide_image 0 0 x y sld)
    (end_image)
    )
      a
      (strcat "E:\\Program Files\\AutoCAD 2010\\Support\\test\\" a ".sld" )
      )
       )
    sld
    ) ;_ end of mapcar

lucas_3333 发表于 2014-7-31 11:12:48

edata 发表于 2014-7-31 10:51 static/image/common/back.gif
这句之前
因为mapcar需要调用sld变量了。
sld表内容和图形按钮控件key名相同,即幻灯片名和控件key相同。 ...

E大,太棒了,按你说的,一下就成功了!谢谢!
如果不用绝对地址,就不是就将(strcat "E:\\Program Files\\AutoCAD 2010\\Support\\test\\" a ".sld" )换成a ?
页: [1] 2
查看完整版本: 这个地址该如何改?