sean112 发表于 2022-7-5 17:28:47

About get_tile, setting flags,

I am trying to set up a nested dialog box and use autocad commands in it.
 
However, I have learned that we cannot do so while the dialog box is open. So my way of going around is that set a dummy variable to a value, then close dialog box, then use the command.
 
Part of my code is like this:
 

(cond ((= get_tile "T" 1) (setq choices 1)) ((= get_tile "S" 1) (setq choices 2))((= get_tile "C" 1) (setq choices 3))((= get_tile "I" 1) (setq choices 4)))
 
Since my buttons "T", "S", "C", "I" are just regular buttons, I do not think get_tile can achieve what I want here.
 
Also, will the variable choices be stored throughout the whole program or just this function?
 
Thanks for any responses!

Lee Mac 发表于 2022-7-5 18:01:02

Use the done_dialog function within the action_tile statement for your buttons, supplied with a positive integer argument other than 1 & 0 (these should be reserved for accept/cancel tiles); then test for the integer returned by the start_dialog function to determine which button was pressed and hence which operation to perform.

sean112 发表于 2022-7-5 18:14:56

 
Yes! It worked. Instead of using get_tile, I can just use the value I put in done_tile. I set up a variable to the return value of start_dialog, then go from there.
 
As always, THANK YOU Lee Mac!

Lee Mac 发表于 2022-7-5 18:38:40

You're welcome! - I'm glad you were able to develop a solution.
页: [1]
查看完整版本: About get_tile, setting flags,