“收音机”选项1和选项2
大家好,我想知道感觉代码出了什么问题?>>LISP文件>>>
;;;--- If the "Okay" button was pressed
(if (= ddiag 2)
(if(= radios "choice1")
(progn
(setq ip (getpoint "\n Center point: "))
(command "circle" ip pause)
)
;;;--- Else draw a polygon
(progn
(setq ip (getpoint "\n Center Point: "))
(command "_sphere" ip pause)
)
)
)
DCL代码>>>
samp6 : dialog { //dialog name
label = "Cabinet Drawer V2.1" ;//give it a label
: column {
: row { //define row
: boxed_column { //define radio column
: radio_column {
key = "radios" ;
label = "Type" ; //give it a label
: radio_button { //define radion button
key = "choice1" ; //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 = "choice2" ; //give it a name
label = "Cabinet with back" ;//give it a label
} //end definition
}
}
} //end radio column
} //end row
在这段代码中,它总是画一个_球体,没有圆。。。。
致以最诚挚的问候 你好
也许以下是一种选择
(defun c:foo (/ DCL_File DclId toggle ip)
(setq DCL_File "samp6.dcl")
(if
(not
(minusp
(setq DclId (load_dialog DCL_File)))
)
(progn
;Create dialog
(new_dialog "samp6" DclId)
;When user hits ok return value of first radio button
(action_tile
"accept"
"(setq toggle (get_tile\"choice1\"))")
(start_dialog)
(if
;Choice1 highlighted RETVAL toggle = "1"
;Choice2 highlighted RETVAL toggle = "0"
(= toggle "1")
(progn
(setq ip (getpoint "\n Center point: "))
(command "circle" ip pause))
;;;--- Else draw a polygon
(progn
(setq ip (getpoint "\n Center Point: "))
(command "_sphere" ip pause))
)
)
)
)
samp6 : dialog { //dialog name
label = "Cabinet Drawer V2.1" ;//give it a label
: column {
: row { //define row
: boxed_column { //define radio column
: radio_column {
key = "radios" ;
label = "Type" ; //give it a label
: radio_button { //define radion button
key = "choice1" ; //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 = "choice2" ; //give it a name
label = "Cabinet with back" ;//give it a label
} //end definition
}
}
} //end radio column
} //
ok_only ;
}
当做
杰米 嗯,现在我认为这是不正确的提交。。。我应该设置整个代码。。。我做了我自己。也许我忘了什么,我在一个先发球场。。。。
Lisp程序
(defun C:samp6()
;;;--- Load the dcl file
(setq dcl_id (load_dialog "samp6.dcl"))
;;;--- Load the dialog definition if it is not already loaded
(if (not (new_dialog "samp6" dcl_id))
(progn
(alert "The samp6.DCL file could not be loaded!")
(exit)
)
)
;;;--- If an action event occurs, do this function
(action_tile "cancel" "(setq ddiag 1)(done_dialog)")
(action_tile "accept" "(setq ddiag 2)(done_dialog)")
;;;--- Display the dialog box
(start_dialog)
;;;--- Unload the dialog box
(unload_dialog dcl_id)
;;;--- If the cancel button was pressed - display message
(if (= ddiag 1)
(princ "\n \n ...samp6 Cancelled. \n ")
)
;;;--- If the "Okay" button was pressed
(if (= ddiag 2)
(if(= radios "choice1")
(progn
(setq pt(getpoint "\n Center point: "))
(command "circle" pt pause)
)
;;;--- Else draw a sphere
(progn
(setq pt(getpoint "\n Center Point: "))
(command "_sphere" pt pause)
)
)
)
;;;--- Suppress the last echo for a clean exit
(princ)
)
Dcl。。
samp6 : dialog { //dialog name
label = "Cabinet Drawer V2.1" ;//give it a label
: column {
: row { //define row
: boxed_column { //define radio column
: radio_column {
label = "Type" ; //give it a label
key = "radios" ;
: radio_button { //define radion button
key = "choice1" ; //give it a name
label = "Cabinet free standing" ; //give it a label
value = "0" ; //switch it on
} //end definition
: radio_button { //define radio button
key = "choice2" ; //give it a name
label = "Cabinet with back" ;//give it a label
value = "0" ;
} //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
value = "";
} //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
value = "";
} //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
value = "";
} //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
value = "";
} //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
value = "";
} //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
value = "";
} //end edit box
//end edit box
} //end boxed column
:toggle{
key = "save";
label = "Save Settings";
value = 1;
}
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
我也相信我一定要救人?我不知道这意味着什么。。。
希望你能在……方面提供帮助。。。
ps1:“通知”。它会打开一个对话框,别提tekst。。它只需通过选择选项1或选项2来绘制球体和圆。
致以最诚挚的问候
页:
[1]