A tile 'key' attribute is only required if the tile needs to be manipulated at runtime by the program - the key provides a way to uniquely reference the tile.After reading your comment I'm left with the impression that the whole thing works like an association list:
Provided a tile has either the is_default or is_cancel attribute, you can load & display a dialog with no tile keys:Code - Auto/Visual Lisp: [Select]
'( ( m ) ) ) (princ "d:dialog{spacer;:edit_box{edit_width=20;}:button{label=\"Exit\";is_cancel=true;}spacer;}" des) ) )
'((<Key1> <Label1> <Value1> <Expr1>)(<Key2> <Label2> <Value2> <Expr2>) .... (<KeyN> <LabelN> <ValueN> <ExprN>))
Where each item represents a tile and depending on your intentions, you might want to(or not) assign something to it.ok_cancel_help_info;
ok_cancel_help_errtile;
Thank you!
Provided a tile has either the is_default or is_cancel attribute...An action attribute defined in the DCL that includes (done_dialog) also works.
After reading your comment I'm left with the impression that the whole thing works like an association list:Code: [Select]'((<Key1> <Label1> <Value1> <Expr1>)(<Key2> <Label2> <Value2> <Expr2>) .... (<KeyN> <LabelN> <ValueN> <ExprN>))
Where each item represents a tile and depending on your intentions, you might want to(or not) assign something to it.
And ofcourse accesing the tile through its <Key> (optional), similarly to the Tile- and Attribute-Handling Functions aka *_tile functions, like you said "if the tile needs to be manipulated".
Tho replicating the ok and cancel buttons by using is_default or is_cancel attributes, I wanted to ask how to access the help, info and errtile tiles, when using these built-in functions:Code: [Select]ok_cancel_help_info;
ok_cancel_help_errtile;
Provided a tile has either the is_default or is_cancel attribute...An action attribute defined in the DCL that includes (done_dialog) also works.
I don't see the link to an association list, but note that you can assign labels & values to tiles without keys.Sorry I was trying to explain this to myself in lisp words (the tile and their attributes thing), since the DCL LSP connection is inevitable.
The "ok" tile has key "accept" and the errtile has key "error"; the other tiles have keys equal to their tile names.Now I'll remember that the following names for keys:
See:
http://help.autodesk.com/view/ACD/2016/ENU/?guid=GUID-0376DCD0-ACF6-4269-982E-E396E81C4D93
http://help.autodesk.com/view/ACD/2016/ENU/?guid=GUID-BA3EADFA-E2D7-4D85-9282-3CBB0D83499E
http://help.autodesk.com/view/ACD/2016/ENU/?guid=GUID-DF8DA7C3-7F7E-471C-A6B9-1A5D986CD6E9
http://help.autodesk.com/view/ACD/2016/ENU/?guid=GUID-01A41A6D-5972-4A33-99B8-BA7B7A379527
http://help.autodesk.com/view/ACD/2016/ENU/?guid=GUID-9FB4A683-23CA-4B6C-A5EF-5E43AE7C8D4B
"accept" "cancel" "help" "info" "error"
Are "protected" (like saying protected symbols) so will try to avoid these names when manually asignning a key attribute.Now I'll remember that the following names for keys:Code: [Select]"accept" "cancel" "help" "info" "error"
Are "protected" (like saying protected symbols) so will try to avoid these names when manually asignning a key attribute.
Thanks alot, you are very helpful! :)
Hi Lee,Code - Auto/Visual Lisp: [Select]
"dia : dialog" "{" " label = \"Example\";" " children_alignment = centered;" " spacer;" " : edit_box { edit_width=40; }" " spacer;" " : button" " {" " label = \"• Custom OK Button •\";" " fixed_width = true;" " height = 3.0;" " key = \"accept\";" " is_default = true;" " }" " spacer;" "}" )
On the contrary - since these tiles have predefined action statements, you can exploit this to avoid the need to define action_tile expressions for your tiles:Now I know that:
Are you saying that (done_dialog) is not allowed in an action attribute? That seems strange.Provided a tile has either the is_default or is_cancel attribute...An action attribute defined in the DCL that includes (done_dialog) also works.
Note that this is not valid in AutoCAD; also, the action attribute value will only be evaluated for tiles with keys.
Roy, he was 'talking' about tiles with no keys (then you cannot asign <expr> using action_tile).Are you saying that (done_dialog) is not allowed in an action attribute? That seems strange.Provided a tile has either the is_default or is_cancel attribute...An action attribute defined in the DCL that includes (done_dialog) also works.
Note that this is not valid in AutoCAD; also, the action attribute value will only be evaluated for tiles with keys.
Is there a reason not to assign a Key or Attribute or a Value onto a tile?
I love the DCL-string formatting you did, do you use some snippet for this?
Because I think about writing some (in case you did this by hand).
BTW, Nice thread! (sorry for the offtopic)
On the contrary - since these tiles have predefined action statements, you can exploit this to avoid the need to define action_tile expressions for your tiles:Now I know that:Code - Auto/Visual Lisp: [Select]Just like roy_043 mentioned.
is_default; equals to (action_tile "accept" "(done_dialog 1)") is_cancel; equals to (action_tile "cancel" "(done_dialog 0)")
Are you saying that (done_dialog) is not allowed in an action attribute? That seems strange.Note that this is not valid in AutoCAD; also, the action attribute value will only be evaluated for tiles with keys.Provided a tile has either the is_default or is_cancel attribute...An action attribute defined in the DCL that includes (done_dialog) also works.
Thanks Lee,I love the DCL-string formatting you did, do you use some snippet for this?
I write DCL code in the Visual LISP IDE, and use the same to convert to string format simply using the various find/replace/prefix/append options offered by the IDE.Because I think about writing some (in case you did this by hand).
BTW, Nice thread! (sorry for the offtopic)
You may get some ideas from this old program: Format DCL (http://lee-mac.com/formatdcl.html).
Completely nuts how a 10 year old post contributed to this thread. :crazy2:Oh don't worry, everyone gets old... I also wish I started with lisp 10 years ago.
I feel old. :cry:
Oh don't worry, everyone gets old... I also wish I started with lisp 10 years ago.
Tho, its nice that this forum is still alive. :smitten:
MP, don't you ever consider at becomming a drafter ? With such programming skills you'll be able to automate any engineering tasks and able to do them in no time.
But theres one unwritten rule, that you have to waste a few days relaxing/watching movies/whatever, before to liying to your boss that you almost made it till the deadline. :D
Otherwise he will be like "he made it in no time, perhaps I should give him more tasks instead of raising his salary."
As for me (currently a drafter) the endless passion and interest of programming brought me here, started from my lazy drafter's spirit.
Sadly the programmer's and drafter's work is evaluated differently, so won't one become both? :evillaugh: