mitchellrodhous 发表于 2022-7-6 10:52:34

弹出/对话框?

大家好,
 
嗯,我看了一些人的最棒的LISP例程,我总是看到一种弹出/对话框,当你创建你的函数。如附件图像。。。
我的问题;他们是一个小的基础教程,或者有人能告诉我如何创建这些弹出窗口/对话框吗?
我认为也可以在一个LISP/pop-up/dialog对话框中激活不同的LISP例程。
 

上面你看到一个弹出/对话框,你可以通过在这个弹出/对话框中插入值来创建一些东西。
有人知道好的家庭教师吗?
 
尊敬的先生

MSasu 发表于 2022-7-6 11:09:44

您可以从这些教程开始学习DCL接口。
 
当做

manirpg 发表于 2022-7-6 11:20:40

你好
这里有一些不错的网站,所以你可以得到DCL教程供你参考。。。。。
http://jefferypsanders.com/
http://www.afralisp.net/
 
直接链接
http://www.jefferypsanders.com/autolisp_DCL.html
http://www.afralisp.net/dialog-control-language/
 
当做
马尼语:D

mitchellrodhous 发表于 2022-7-6 11:26:57

嗯,我有一些业余时间,所以我有时间阅读这些教程,我用其中的一个作为我的基本形式(见附件)。根据我的具体情况进行了更改。最后,我不知道该怎么继续下去。。。
也许有人,也有空闲时间,可以检查,也玩Lisp程序,看看我想达到什么,并帮助我。
 
我试着选择左边的文件柜类型(我用LISP写了这个文件柜,放在其他地方)
 
在右边,我想增加尺寸,三个盒子,一个长度,第二个宽度,第三个深度。
通过点击“OK”按钮,他必须使用一个LISP例程,该例程属于左侧的type cabinet。使用我在右侧添加的尺寸。
 
ps1:可能dcl或lsp文件提供的一些信息对我的选项甚至都不是必需的,我已经注意到刚刚从互联网上复制并更改了它。
 
希望能有任何回应来完成它。
 
尊敬的先生
samp6.DCL
samp6.LSP

mitchellrodhous 发表于 2022-7-6 11:33:56

我自己也有点进步。。。也许有人能给我解释一下。。。。
 
我在dcl代码中用红色和绿色标记了一些东西。。
 
samp6 : dialog {    //dialog name
   label = "Cabinet Drawer V2.1" ;//give it a label

      : row {   //define row

      :boxed_radio_column {   //define radio column
      label = "Type" ;    //give it a label

       : radio_button {   //define radion button
       key = "rb1" ;    //give it a name
       label = "Cabinet free standing" ; //give it a label
       value = "1" ;    //switch it on
       }   //end definition

   : radio_button {   //define radio button
       key = "rb2" ;    //give it a name
       label = "Cabinet with back" ;//give it a label
   }   //end definition

       }   //end radio column
       }   //end row

       : boxed_column {   //define boxed column
         label = "&Size";   //give it a label

      
       : edit_box {    //define edit box
         key = "eb1" ;    //give it a name
         label = "Length :" ;   //give it a label
         edit_width = 10 ;   //30 characters
       }   //end edit box
   //end edit box
: edit_box {    //define edit box
         key = "eb2" ;   //give it a name
         label = "Widht :" ;   //give it a label
         edit_width = 10 ;   //30 characters
       }   //end edit box
   //end edit box
: edit_box {    //define edit box
         key = "eb3" ;   //give it a name
         label = "Depth :" ;   //give it a label
         edit_width = 10 ;   //30 characters
       }   //end edit box
   //end edit box

: edit_box {    //define edit box
         key = "eb4" ;   //give it a name
         label = "Materialethickness :" ; //give it a label
         edit_width = 10 ;   //30 characters
       }   //end edit box
   //end edit box
      
      }   //end boxed column
       : boxed_column {   //define boxed column
         label = "&Specifics";   //give it a label


         
       : edit_box {    //define edit box
         key = "eb5" ;    //give it a name
         label = "Back offset :" ;//give it a label
         edit_width = 10 ;   //30 characters
       }   //end edit box
   //end edit box
       : edit_box {    //define edit box
         key = "eb6" ;    //give it a name
         label = "Thickness back :" ;//give it a label
         edit_width = 10 ;   //30 characters
       }   //end edit box
   //end edit box
      }   //end boxed column

      

    ok_cancel ;    //predifined OK/Cancel

    : row {   //define row

    : image {   //define image tile
    key = "im" ;    //give it a name
    height = 1.0 ;    //and a height
    width = 1.0 ;    //and now a width
    }      //end image

    : paragraph {    //define paragraph

    : text_part {    //define text
    label = "Designed and Created";//give it some text
    }      //end text

    : text_part {    //define more text
    label = "By MR. CAD - MITCHELL RODHOUSE"; //some more text
    }      //end text

    }      //end paragraph

    }      //end row
   
    }      //end dialog
 
我想用红色标记的falues作为我用绿色标记的lisp的falues。(如果它在命令行中询问我想在这个对话框中输入的错误,我已经编写了lisp文件)。
 
还有一件事,我想通过点击单选按钮激活两个lisp文件中的一个。
任何帮助都将不胜感激!
 
致以最诚挚的问候

mitchellrodhous 发表于 2022-7-6 11:46:31

嗯,没有太多的回应,我希望他们是专家足够在这个论坛上帮助我了。。。
有人知道我如何使用我在这个对话框中插入的信息吗?我想我只需要插入一些命令提示,但我不知道该如何开始。。。。
 
LISP文件
(defun C:samp6 ()   ;define function

(setq dcl_id (load_dialog "samp7.dcl"));load dialog

(if (not (new_dialog "samp6" dcl_id)   ;test for dialog

   );not

   (exit)      ;exit if no dialog

);if

(setq w (dimx_tile "im")    ;get image tile width
       h1 (dimy_tile "im")    ;get image tile height
b "eb2"      ;Set Widht of the cabinet
h "eb1"      ;Set Hight of the cabinet
d "eb3"      ;Set Depth of the cabinet
m "eb4"      ;Set materialthickness
ba "eb5"   ;Set offset back
bat "eb6"   ;Set thickness back



);setq

(start_image "im")   ;start the image
(fill_image 0 0 w h1 5)    ;fill it with blue
(end_image)      ;end image

(action_tile "rb1" "(setq hole \"site\")");store hole type
(action_tile "rb2" "(setq hole \"shop\")");store hole type
(action_tile "rb3" "(setq hole \"hid\")");store hole type
(action_tile "rb4" "(setq hole \"ctsk\")");store hole type
(action_tile "rb5" "(setq hole \"elev\")");store hole type
(action_tile "rb6" "(setq hole \"slot\");store hole type
                     (mode_tile \"eb1\" 0);enable edit box
                     (mode_tile \"eb1\" 2)");switch focus to edit box

   (action_tile
   "cancel"      ;if cancel button pressed
   "(done_dialog) (setq userclick nil)";close dialog, set flag
   );action_tile

(action_tile
   "accept"      ;if O.K. pressed
   (strcat      ;string 'em together
   "(setq notes (get_tile \"eb1\"))"   ;get notes

   " (done_dialog)(setq userclick T))";close dialog, set flag
   );strcat

);action tile

(start_dialog)   ;start dialog

(unload_dialog dcl_id)    ;unload

(if userclick   ;check O.K. was selected
   (progn



   );progn

);if userclick

(princ)

);defun C:samp

(princ)

 
 
DCL文件
samp6 : dialog {    //dialog name
   label = "Cabinet Drawer V2.1" ;//give it a label

      : row {   //define row

      :boxed_radio_column {   //define radio column
      label = "Type" ;    //give it a label

       : radio_button {   //define radion button
       key = "rb1" ;    //give it a name
       label = "Cabinet free standing" ; //give it a label
       value = "1" ;    //switch it on
       }   //end definition

   : radio_button {   //define radio button
       key = "rb2" ;    //give it a name
       label = "Cabinet with back" ;//give it a label
   }   //end definition

       }   //end radio column
       }   //end row

       : boxed_column {   //define boxed column
         label = "&Size";   //give it a label


       : edit_box {    //define edit box
         key = "eb1" ;    //give it a name
         label = "Length :" ;   //give it a label
         edit_width = 10 ;   //30 characters
       }   //end edit box
   //end edit box
: edit_box {    //define edit box
         key = "eb2" ;   //give it a name
         label = "Widht :" ;   //give it a label
         edit_width = 10 ;   //30 characters
       }   //end edit box
   //end edit box
: edit_box {    //define edit box
         key = "eb3" ;   //give it a name
         label = "Depth :" ;   //give it a label
         edit_width = 10 ;   //30 characters
       }   //end edit box
   //end edit box

: edit_box {    //define edit box
         key = "eb4" ;   //give it a name
         label = "Materialethickness :" ; //give it a label
         edit_width = 10 ;   //30 characters
       }   //end edit box
   //end edit box

      }   //end boxed column
       : boxed_column {   //define boxed column
         label = "&Specifics";   //give it a label



       : edit_box {    //define edit box
         key = "eb5" ;    //give it a name
         label = "Back offset :" ;//give it a label
         edit_width = 10 ;   //30 characters
       }   //end edit box
   //end edit box
       : edit_box {    //define edit box
         key = "eb6" ;    //give it a name
         label = "Thickness back :" ;//give it a label
         edit_width = 10 ;   //30 characters
       }   //end edit box
   //end edit box
      }   //end boxed column



    ok_cancel ;    //predifined OK/Cancel

    : row {   //define row

    : image {   //define image tile
    key = "im" ;    //give it a name
    height = 1.0 ;    //and a height
    width = 1.0 ;    //and now a width
    }      //end image

    : paragraph {    //define paragraph

    : text_part {    //define text
    label = "Designed and Created";//give it some text
    }      //end text

    : text_part {    //define more text
    label = "By MR. CAD - MITCHELL RODHOUSE"; //some more text
    }      //end text

    }      //end paragraph

    }      //end row

    }      //end dialog

 
尊敬的先生

MSasu 发表于 2022-7-6 11:57:01

我的建议是遵循上述教程,然后开始将您在这些课程中设计的简单对话框合并为更复杂的对话框。下一步将从这个论坛下载一些示例,并尝试理解它们的代码。祝你好运
 
当做
页: [1]
查看完整版本: 弹出/对话框?