乐筑天下

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

[编程交流] “收音机”选项1和选项2

[复制链接]

10

主题

56

帖子

46

银币

初露锋芒

Rank: 3Rank: 3Rank: 3

铜币
50
发表于 2022-7-6 10:52:12 | 显示全部楼层 |阅读模式
大家好,我想知道感觉代码出了什么问题?>>
 
LISP文件>>>
 
  1. ;;;--- If the "Okay" button was pressed
  2. (if (= ddiag 2)
  3.    (if(= radios "choice1")
  4. (progn
  5.       (setq ip (getpoint "\n Center point: "))
  6.       (command "circle" ip pause)
  7. )
  8.      ;;;--- Else draw a polygon
  9. (progn
  10.    (setq ip (getpoint "\n Center Point: "))
  11.    (command "_sphere" ip pause)
  12. )
  13. )
  14. )

 
 
DCL代码>>>
 
  1. samp6 : dialog {    //dialog name
  2.      label = "Cabinet Drawer V2.1" ;  //give it a label
  3.       : column {
  4.       : row {     //define row
  5.       : boxed_column {    //define radio column
  6.       : radio_column {
  7.       key = "radios" ;
  8.       label = "Type" ;    //give it a label
  9.        : radio_button {   //define radion button
  10.        key = "choice1" ;   //give it a name
  11.        label = "Cabinet free standing" ; //give it a label
  12.        value = "1" ;    //switch it on
  13.        }     //end definition
  14.      : radio_button {   //define radio button
  15.        key = "choice2" ;   //give it a name
  16.        label = "Cabinet with back" ;  //give it a label
  17.      }     //end definition
  18.      }
  19.      }
  20.        }     //end radio column
  21.        }     //end row

 
在这段代码中,它总是画一个_球体,没有圆。。。。
致以最诚挚的问候
回复

使用道具 举报

5

主题

194

帖子

193

银币

初来乍到

Rank: 1

铜币
24
发表于 2022-7-6 11:43:42 | 显示全部楼层
你好
 
也许以下是一种选择
 
  1. (defun c:foo (/ DCL_File DclId toggle ip)
  2. (setq DCL_File "samp6.dcl")
  3. (if
  4.    (not
  5.      (minusp
  6. (setq DclId (load_dialog DCL_File)))
  7.      )
  8.    (progn
  9.      ;Create dialog
  10.      (new_dialog "samp6" DclId)
  11.      ;When user hits ok return value of first radio button
  12.      (action_tile
  13. "accept"
  14. "(setq toggle (get_tile  "choice1"))")
  15.      (start_dialog)
  16.      (if
  17. ;Choice1 highlighted RETVAL toggle = "1"
  18. ;Choice2 highlighted RETVAL toggle = "0"
  19. (= toggle "1")
  20. (progn
  21.   (setq ip (getpoint "\n Center point: "))
  22.   (command "circle" ip pause))
  23.      ;;;--- Else draw a polygon
  24.      (progn
  25. (setq ip (getpoint "\n Center Point: "))
  26. (command "_sphere" ip pause))
  27.      )
  28.      )
  29.    )
  30. )

 
  1. samp6 : dialog {    //dialog name
  2.      label = "Cabinet Drawer V2.1" ;  //give it a label
  3.       : column {
  4.       : row {     //define row
  5.       : boxed_column {    //define radio column
  6.       : radio_column {
  7.       key = "radios" ;
  8.       label = "Type" ;    //give it a label
  9.        : radio_button {   //define radion button
  10.        key = "choice1" ;   //give it a name
  11.        label = "Cabinet free standing" ; //give it a label
  12.        value = "1" ;    //switch it on
  13.        }     //end definition
  14.      : radio_button {   //define radio button
  15.        key = "choice2" ;   //give it a name
  16.        label = "Cabinet with back" ;  //give it a label
  17.      }     //end definition
  18.      }
  19.      }
  20.    
  21.        }     //end radio column
  22.       
  23.        }     //
  24.       ok_only ;
  25.       }

 
当做
 
杰米
回复

使用道具 举报

10

主题

56

帖子

46

银币

初露锋芒

Rank: 3Rank: 3Rank: 3

铜币
50
发表于 2022-7-6 12:02:32 | 显示全部楼层
嗯,现在我认为这是不正确的提交。。。我应该设置整个代码。。。我做了我自己。也许我忘了什么,我在一个先发球场。。。。
 
Lisp程序
  1. (defun C:samp6()
  2. ;;;--- Load the dcl file
  3. (setq dcl_id (load_dialog "samp6.dcl"))
  4. ;;;--- Load the dialog definition if it is not already loaded
  5. (if (not (new_dialog "samp6" dcl_id))
  6.    (progn
  7.     (alert "The samp6.DCL file could not be loaded!")
  8.      (exit)
  9.    )
  10. )
  11. ;;;--- If an action event occurs, do this function
  12. (action_tile "cancel" "(setq ddiag 1)(done_dialog)")
  13. (action_tile "accept" "(setq ddiag 2)(done_dialog)")
  14. ;;;--- Display the dialog box
  15. (start_dialog)
  16. ;;;--- Unload the dialog box
  17. (unload_dialog dcl_id)
  18. ;;;--- If the cancel button was pressed - display message
  19. (if (= ddiag 1)
  20.    (princ "\n \n ...samp6 Cancelled. \n ")
  21. )
  22. ;;;--- If the "Okay" button was pressed
  23. (if (= ddiag 2)
  24. (if(= radios "choice1")
  25. (progn
  26.    (setq pt(getpoint "\n Center point: "))
  27.    (command "circle" pt pause)
  28. )
  29. ;;;--- Else draw a sphere
  30. (progn
  31.    (setq pt(getpoint "\n Center Point: "))
  32.    (command "_sphere" pt pause)
  33. )
  34. )
  35. )
  36. ;;;--- Suppress the last echo for a clean exit
  37. (princ)
  38. )

 
Dcl。。
 
  1. samp6 : dialog {    //dialog name
  2.      label = "Cabinet Drawer V2.1" ;  //give it a label
  3.       : column {
  4.       : row {     //define row
  5.       : boxed_column {    //define radio column
  6.       : radio_column {
  7. label = "Type" ;   //give it a label
  8.        key = "radios" ;
  9.        : radio_button {   //define radion button
  10.        key = "choice1" ;   //give it a name
  11.        label = "Cabinet free standing" ; //give it a label
  12.        value = "0" ;    //switch it on
  13.        }     //end definition
  14.      : radio_button {   //define radio button
  15.        key = "choice2" ;   //give it a name
  16.        label = "Cabinet with back" ;  //give it a label
  17.        value = "0" ;
  18.      }     //end definition
  19.      }
  20.      }
  21.        }     //end radio column
  22.        }     //end row
  23.       
  24.        : boxed_column {   //define boxed column
  25.          label = "&Size";   //give it a label
  26.        : edit_box {    //define edit box
  27.          key = "eb1" ;    //give it a name
  28.          label = "Length :" ;   //give it a label
  29.          edit_width = 10 ;   //30 characters
  30.          value = "";
  31.        }     //end edit box
  32.      //end edit box
  33.   : edit_box {    //define edit box
  34.            key = "eb2" ;   //give it a name
  35.            label = "Widht :" ;   //give it a label
  36.            edit_width = 10 ;   //30 characters
  37.            value = "";
  38.        }     //end edit box
  39.      //end edit box
  40.   : edit_box {    //define edit box
  41.            key = "eb3" ;   //give it a name
  42.            label = "Depth :" ;   //give it a label
  43.            edit_width = 10 ;   //30 characters
  44.            value = "";
  45.        }     //end edit box
  46.      //end edit box
  47.   : edit_box {    //define edit box
  48.            key = "eb4" ;   //give it a name
  49.            label = "Materialethickness :" ; //give it a label
  50.            edit_width = 10 ;   //30 characters
  51.            value = "";
  52.        }     //end edit box
  53.      //end edit box
  54.       }     //end boxed column
  55.        : boxed_column {   //define boxed column
  56.          label = "&Specifics";   //give it a label
  57.        : edit_box {    //define edit box
  58.          key = "eb5" ;    //give it a name
  59.          label = "Back offset :" ;  //give it a label
  60.          edit_width = 10 ;   //30 characters
  61.          value = "";
  62.        }     //end edit box
  63.      //end edit box
  64.        : edit_box {    //define edit box
  65.          key = "eb6" ;    //give it a name
  66.          label = "Thickness back :" ;  //give it a label
  67.          edit_width = 10 ;   //30 characters
  68.          value = "";
  69.        }     //end edit box
  70.      //end edit box
  71.       }     //end boxed column
  72.    :toggle{
  73.      key = "save";
  74.      label = "Save Settings";
  75.      value = 1;
  76.     }
  77.     ok_cancel ;    //predifined OK/Cancel
  78.     : row {     //define row
  79.     : image {     //define image tile
  80.     key = "im" ;    //give it a name
  81.     height = 1.0 ;    //and a height
  82.     width = 1.0 ;    //and now a width
  83.     }      //end image
  84.     : paragraph {    //define paragraph
  85.     : text_part {    //define text
  86.     label = "Designed and Created";  //give it some text
  87.     }      //end text
  88.     : text_part {    //define more text
  89.     label = "By MR. CAD - MITCHELL RODHOUSE"; //some more text
  90.     }      //end text
  91.     }      //end paragraph
  92.     }      //end row
  93.     }      //end dialog

 
我也相信我一定要救人?我不知道这意味着什么。。。
希望你能在……方面提供帮助。。。
ps1:“通知”。它会打开一个对话框,别提tekst。。它只需通过选择选项1或选项2来绘制球体和圆。
 
致以最诚挚的问候
回复

使用道具 举报

发表回复

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

本版积分规则

  • 微信公众平台

  • 扫描访问手机版

  • 点击图片下载手机App

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

GMT+8, 2025-3-6 16:53 , Processed in 0.627388 second(s), 58 queries .

© 2020-2025 乐筑天下

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