乐筑天下

搜索
欢迎各位开发者和用户入驻本平台 尊重版权,从我做起,拒绝盗版,拒绝倒卖 签到、发布资源、邀请好友注册,可以获得银币 请注意保管好自己的密码,避免账户资金被盗
查看: 95|回复: 3

[编程交流] 我的脚法差不多了

[复制链接]

9

主题

25

帖子

16

银币

初来乍到

Rank: 1

铜币
45
发表于 2022-7-5 19:51:08 | 显示全部楼层 |阅读模式
大家好
 
我差一点就成功了,但我看不出有什么错误
虽然我知道可能有很多其他的方法来实现我在这里尝试的,幽默我将你与这一个。
 
当做
 
托尼
 
这是我的DCL代码
 
  1. tozafootingsRD
  2. : dialog { label = "Insert a Footing " ;
  3. : row {
  4. : boxed_column { label = "Cylindrical Footing" ;
  5. : boxed_column {            
  6. : image { key = "cylinder" ; height = 8.0 ; width = 30.0 ;   
  7. fixed_width = true; fixed_height = true;  color = 0 ;}
  8.         }
  9. : boxed_column {
  10. : edit_box { key = "rdc"; label = "Diameter of Footing"; edit_width = 6;
  11. alignment = left ;  allow_accept   =  true;}
  12. : edit_box { key = "rdd"; label = "Depth of Footing"; edit_width = 6;
  13. alignment = left ;  allow_accept   =  true;}
  14.                }
  15.             }      
  16. : spacer {}
  17.     }
  18. ok_cancel ;      
  19. }

 
这是我的LISP代码
 
  1. (defun C:tozafootingsRD (/ c1)
  2. (setq dcl_id (load_dialog "tozafootingsRD.dcl"))
  3.    (if (not (new_dialog "tozafootingsRD" dcl_id)
  4. )
  5. (exit)
  6. )
  7. (setq w (dimx_tile "cylinder")
  8.        h (dimy_tile "cylinder")
  9.     )
  10. (start_image "cylinder")  
  11. (slide_image 0 0 w h "LBOLTS.sld")
  12. (end_image)
  13. (defun setVars (/ d1 d2)
  14. (setq d1 (distof (get_tile "rdc"))
  15.        d2 (distof (get_tile "rdd"))
  16.     )   
  17. )
  18. (action_tile "accept" "(setVars) (done_dialog) (setq userclick T)")
  19. (setq c1 (getpoint "\nPick Centre Top of footing "))
  20. (command "cylinder" c1 (/ d1 2) (- d2))
  21. (action_tile "cancel" "(done_dialog) (setq userclick nil)")       
  22. (start_dialog)       
  23. (unload_dialog dcl_id)
  24. (princ)
  25. )
回复

使用道具 举报

63

主题

6297

帖子

6283

银币

后起之秀

Rank: 20Rank: 20Rank: 20Rank: 20

铜币
358
发表于 2022-7-5 20:21:18 | 显示全部楼层
试试这个Tony
 
  1. (defun c:Test  (/ i d1 d2 c)
  2. ;; Tharwat 28.4.2015        ;;
  3. (if
  4.    (or (not (< 0 (setq i (load_dialog "tozafootingsRD.dcl"))))
  5.        (not (new_dialog "tozafootingsRD" i))
  6.        )
  7.     (exit)
  8.     (progn
  9.       (start_image "cylinder")
  10.       (slide_image 0 0 (dimx_tile "cylinder")
  11.                        (dimy_tile "cylinder")
  12.                                               "LBOLTS.sld")
  13.       (end_image)
  14.       (action_tile "accept" "(setq d1 (distof (get_tile "rdc"))
  15.                                    d2 (distof (get_tile "rdd"))
  16.                                    )
  17.                               (done_dialog)")
  18.       (action_tile "cancel" "(done_dialog)")
  19.       (start_dialog)
  20.       (unload_dialog i)
  21.       ))
  22. (if (and d1 d2  (setq c (getpoint "\nPick Centre Top of footing :")))
  23.      (command "_.cylinder" "_none" c (/ d1 2) (- d2))
  24.    )
  25. (princ)
  26. )
回复

使用道具 举报

9

主题

25

帖子

16

银币

初来乍到

Rank: 1

铜币
45
发表于 2022-7-5 20:38:53 | 显示全部楼层
谢谢Tharwat我会试试的
 
当做
 
托尼
回复

使用道具 举报

63

主题

6297

帖子

6283

银币

后起之秀

Rank: 20Rank: 20Rank: 20Rank: 20

铜币
358
发表于 2022-7-5 21:03:34 | 显示全部楼层
 
不客气,托尼。
 
如果你有任何问题,请告诉我。
回复

使用道具 举报

发表回复

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

本版积分规则

  • 微信公众平台

  • 扫描访问手机版

  • 点击图片下载手机App

QQ|关于我们|小黑屋|乐筑天下 繁体中文

GMT+8, 2025-3-12 01:54 , Processed in 0.411265 second(s), 60 queries .

© 2020-2025 乐筑天下

联系客服 关注微信 帮助中心 下载APP 返回顶部 返回列表