找回密码
 立即注册

QQ登录

只需一步,快速开始

扫一扫,访问微社区

查看: 697|回复: 2

[LISP程序]:请各位高手帮帮忙

[复制链接]
发表于 2006-5-22 12:28:59 | 显示全部楼层 |阅读模式

马上注册,结交更多好友,享用更多功能,让你轻松玩转社区。

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

×
这段程序不能执行最后的插入块操作,但是小弟不知道如何修改,请各位高手帮忙
lisp:
(defun initimg (image sld)
  (start_image image)
  (slide_image 0 0 (dimx_tile image) (dimy_tile image) sld)
  (end_image)
)
(defun dlg2 ()
  (initimg "aa" "12")
  (set_tile "n" (rtos 2 2))
  (action_tile "base1" "(getdata2) (dlg4)")
  (action_tile "accept" "(getdata2) (done_dialog 1)")
  (action_tile "cancel" "(done_dialog 0)")
)
(defun dlg3 ()
  (initimg "bb" "34")
  (set_tile "m" (rtos 2 2))
  (action_tile "base2" "(getdata3) (dlg4)")
  (action_tile "accept" "(getdata3) (done_dialog 1)")
  (action_tile "cancel" "(done_dialog 0)")
)
(defun dlg4 ()
  (if (not (new_dialog "hehe" dcl_id))
    (exit)
  )
  (set_tile "x" (rtos x 2 2))
  (set_tile "y" (rtos y 2 2))
  (action_tile "pick" "(done_dialog 2)")
  (action_tile "accept" "(getdata4) (done_dialog 3)")
  (action_tile "cancel" "(done_dialog 4)")
  (setq what (start_dialog))
  (if (= what 2)
    (done_dialog 2)
  )
)
(defun getdata2    ()
  (setq n (atof (get_tile "n")))
)
(defun getdata3    ()
  (setq m (atof (get_tile "m")))
)
(defun getdata4    ()
  (setq x (atof (get_tile "x")))
  (setq y (atof (get_tile "y")))
)

(defun c:addl (/ dcl_id tfb dclid ipos n m x y what p)
  (setq tfb '("进入" "离开"))
  (setq dclid '("haha" "heihei"))
  (setq dcl_id (load_dialog "11.dcl"))
  (if (not (new_dialog "kaka" dcl_id))
    (exit)
  )
  (start_list "list")
  (mapcar 'add_list tfb)
  (end_list)
  (set_tile "list" "0")
  (setq ipos 0)
  (action_tile "list" "(setq ipos (atoi $value))")
  (action_tile "accept" "(done_dialog 1)")
  (action_tile "cancel" "(done_dialog)")
  (if (= (start_dialog) 1)
    (progn (new_dialog (nth ipos dclid) dcl_id)
       (action_tile "accept" "(done_dialog 2)")
       (action_tile "cancel" "(done_dialog)")
       (setq x 0
         y 0
         m 0
         n 0
         what 3
       )
       (if (= ipos 0)
        (progn (while (> what 1)
           (dlg2)
           (if (= what 2)
         (dlg4)
           )
           (if (/= what 2)
         (setq what (start_dialog))
           )
           (if (= what 2)
         (progn
           (initget 1)
           (setq p (getpoint "\nbase point:"))
           (setq x (car p)
             y (cadr p)
           )
         )
           )
         )
         (if (= what 1) (command "insert" "进入通道块.dwg" p 1.0 1.0 0))
        )
        (progn (while (> what 1)
           (dlg3)
           (if (= what 2)
         (dlg4)
           )
           (if (/= what 2)
         (setq what (start_dialog))
           )
           (if (= what 2)
         (progn
           (initget 1)
           (setq p (getpoint "\nbase point:"))
           (setq x (car p)
             y (cadr p)
           )
         )
           )
         )
         (if (= what 1) (command "insert" "离开通道块.dwg" p 1.0 1.0 0))
         )
       )
    )
  )
)


dcl:
kaka:dialog
  {
  label = "请选择插入的块";
  :column
     {
     :popup_list
          {
          label = "请选择要出的通道类型";
          key = "list";
          edit_width = 20;
          list = "进入\n离开";
          }
     :row
       {
       :button
          {label = "确定";
           key = "accept";
           is_default = true;
           }
       :button
          {label = "取消";
           key = "cancel";
          }
       }
      }
  }




haha:dialog
  {
   label = "绘制进入通道";
   :row
     {
     :image
        {
        width = 35;
        height = 8;
        key = "aa";
        color = -2;
        }
     :column
        {
        :edit_box
             {
             label = "&n:=";
             key = "n";
             }
        :button
             {
             label = "插入点";
             key = "base1";
             }
        }
      }
   :row
     {
     :button
         {
         label = "确定";
         key = "accept";
         is_default = true;
         }
     :button
          {label = "取消";
           key = "cancel";
          }
     }
  }




heihei:dialog
  {
   label = "绘制离开通道";
   :row
     {
     :image
        {
        width = 35;
        height = 8;
        key = "bb";
        color = -2;
        }
     :column
        {
        :edit_box
             {
             label = "&m:=";
             key = "m";
             }
        :button
             {
             label = "插入点";
             key = "base2";
             }
        }
      }
   :row
     {
     :button
         {
         label = "确定";
         key = "accept";
         is_default = true;
         }
     :button
          {label = "取消";
           key = "cancel";
          }
     }
  }




hehe:dialog
  {
  label = "插入点";
  :column
    {
    :edit_box
         {
         label = "&x=:";
         key = "x";
         }
    :edit_box
         {
         label = "&y=:";
         key = "y";
         }
    :button
         {
         label = "光标拾取";
         key = "pick";
         }
    :row
      {
     :button
         {
         label = "确定";
         key = "accept";
         is_default = true;
         }
     :button
          {label = "取消";
           key = "cancel";
          }
      }
    }
}

谢谢了~
论坛插件加载方法
发帖求助前要善用【论坛搜索】功能,那里可能会有你要找的答案;
如果你在论坛求助问题,并且已经从坛友或者管理的回复中解决了问题,请把帖子标题加上【已解决】;
如何回报帮助你解决问题的坛友,一个好办法就是给对方加【D豆】,加分不会扣除自己的积分,做一个热心并受欢迎的人!
发表于 2006-5-23 11:58:11 | 显示全部楼层
看晕了呵呵,我也没有办法。等高手回答
论坛插件加载方法
发帖求助前要善用【论坛搜索】功能,那里可能会有你要找的答案;
如果你在论坛求助问题,并且已经从坛友或者管理的回复中解决了问题,请把帖子标题加上【已解决】;
如何回报帮助你解决问题的坛友,一个好办法就是给对方加【D豆】,加分不会扣除自己的积分,做一个热心并受欢迎的人!
回复 支持 反对

使用道具 举报

已领礼包: 11309个

财富等级: 富甲天下

发表于 2006-5-23 22:11:10 | 显示全部楼层

  1. (defun initimg (image sld)
  2. (start_image image)
  3. (slide_image 0 0 (dimx_tile image) (dimy_tile image) sld)
  4. (end_image)
  5. )
  6. (defun dlg2 ()
  7. (initimg "aa" "12")
  8. (set_tile "n" (rtos 2 2))
  9. (action_tile "base1" "(getdata2) (dlg4)")
  10. (action_tile "accept" "(getdata2) (done_dialog 1)")
  11. (action_tile "cancel" "(done_dialog 0)")
  12. )
  13. (defun dlg3 ()
  14. (initimg "bb" "34")
  15. (set_tile "m" (rtos 2 2))
  16. (action_tile "base2" "(getdata3) (dlg4)")
  17. (action_tile "accept" "(getdata3) (done_dialog 1)")
  18. (action_tile "cancel" "(done_dialog 0)")
  19. )
  20. (defun dlg4 ()
  21. (if (not (new_dialog "hehe" dcl_id))
  22.   (exit)
  23. )
  24. (set_tile "x" (rtos x 2 2))
  25. (set_tile "y" (rtos y 2 2))
  26. (action_tile "pick" "(done_dialog 2)")
  27. (action_tile "accept" "(getdata4) (done_dialog 3)")
  28. (action_tile "cancel" "(done_dialog 4)")
  29. (setq what (start_dialog))
  30. (if (= what 2)
  31.   (done_dialog 2)
  32. )
  33. )
  34. (defun getdata2 ()
  35. (setq n (atof (get_tile "n")))
  36. )
  37. (defun getdata3 ()
  38. (setq m (atof (get_tile "m")))
  39. )
  40. (defun getdata4 ()
  41. (setq x (atof (get_tile "x")))
  42. (setq y (atof (get_tile "y")))
  43. )

  44. (defun c:addl (/ dcl_id tfb dclid ipos n m x y what p)
  45. (setq tfb '("进入" "离开"))
  46. (setq dclid '("haha" "heihei"))
  47. (setq dcl_id (load_dialog "11.dcl"))
  48. (if (not (new_dialog "kaka" dcl_id))
  49.   (exit)
  50. )
  51. (start_list "list")
  52. (mapcar 'add_list tfb)
  53. (end_list)
  54. (set_tile "list" "0")
  55. (setq ipos 0)
  56. (action_tile "list" "(setq ipos (atoi $value))")
  57. (action_tile "accept" "(done_dialog 1)")
  58. (action_tile "cancel" "(done_dialog)")
  59. (if (= (start_dialog) 1) (progn
  60.   (new_dialog (nth ipos dclid) dcl_id)
  61.   (action_tile "accept" "(done_dialog 2)")
  62.   (action_tile "cancel" "(done_dialog)")
  63.   (setq x 0 y 0 m 0 n 0 p (list x y) what 3)
  64.   (if (= ipos 0) (progn
  65.    (while (> what 1)
  66.     (dlg2)
  67.     (if (= what 2) (dlg4))
  68.     (if (/= what 2) (setq what (start_dialog)))
  69.     (if (= what 2) (progn
  70.      (initget 1)
  71.      (setq p (getpoint "\nbase point:"))
  72.      (setq x (car p) y (cadr p))
  73.     ))
  74.    )
  75.    (if (= what 1) (command "insert" "进入通道块.dwg" p 1.0 1.0 0))
  76.   ) (progn
  77.    (while (> what 1)
  78.     (dlg3)
  79.     (if (= what 2) (dlg4))
  80.     (if (/= what 2) (setq what (start_dialog)))
  81.     (if (= what 2) (progn
  82.      (initget 1)
  83.      (setq p (getpoint "\nbase point:"))
  84.      (setq x (car p) y (cadr p))
  85.     ))
  86.    )
  87.    (if (= what 1) (command "insert" "离开通道块.dwg" p 1.0 1.0 0))
  88.   ))
  89. ))
  90. )
论坛插件加载方法
发帖求助前要善用【论坛搜索】功能,那里可能会有你要找的答案;
如果你在论坛求助问题,并且已经从坛友或者管理的回复中解决了问题,请把帖子标题加上【已解决】;
如何回报帮助你解决问题的坛友,一个好办法就是给对方加【D豆】,加分不会扣除自己的积分,做一个热心并受欢迎的人!
回复 支持 反对

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

QQ|申请友链|Archiver|手机版|小黑屋|辽公网安备|晓东CAD家园 ( 辽ICP备15016793号 )

GMT+8, 2025-9-29 08:16 , Processed in 0.223961 second(s), 36 queries , Gzip On.

Powered by Discuz! X3.5

© 2001-2025 Discuz! Team.

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