Thats the spirit! Just take it one variable at a time. It will be done before you know it. I will look over what you have posted and get back to you with any suggestions that may be helpful. I noticed you have etc, etc.
You do not need to do this. Just have the program default to the first ones in the lists that will have the program perform correctly. Otherwise, you will need to provide error trapping for all these questions which is overkill. It seems you have the defaults in place already.
When the user selects the OK button without changing anything in the lists, The program will perform without the need for error trapping in this case. It will be upto the user to change the selections as deemed fit.
This will save alot of useless extra programming for starters. I am afraid I have started with such a convoluted method, I am going to have to re-do this thing just to make sense of your few lines....
See if I am catching on here...
(start_list "pl1") (mapcar 'add_list ds_list) (end_list) (setq SYM"Triangle") (if SYM:DEF (set_tile "pl1" (itoa SYM:DEF)))where "pl1" is my popup_list key
and this line
(setq SYM"Triangle")sets the list default value when starting the program?
Then this...
(action_tile "accept" (strcat "(progn (setq S:YM (atoi (get_tile \"pl1\")) SYM:DEF S:YM)"sets the list so it can recall the previous selection?
.
You got it!
Just remember the variables used that are obscure look like this: S:YM, D:SF and are not declared, Because if you declare them their values would be lost upon program completion and they would not remember their last value.
You can also see the transition to another variable that can be declared.
Example:
(cond ((= S:YM 0)(setq SYM "Triangle")) ((= S:YM 1)(setq SYM "Square")) ((= S:YM 2)(setq SYM "Circle")) ) (cond ((= D:SF 0) (setq DSF"1/32\" = 1'")) ((= D:SF 1) (setq DSF"1/16\" = 1'")) ((= D:SF 2) (setq DSF"3/32\" = 1'")) ((= D:SF 3) (setq DSF"1/8\" = 1'")) ((= D:SF 4) (setq DSF"3/16\" = 1'")) ((= D:SF 5) (setq DSF"1/4\" = 1'")) ((= D:SF 6) (setq DSF"3/8\" = 1'")) ((= D:SF 7) (setq DSF"1/2\" = 1'")) ((= D:SF(setq DSF"3/4\" = 1'")) ((= D:SF 9) (setq DSF"1\" = 1'")) ((= D:SF 10)(setq DSF"1-1/2\" = 1'")) ) Please understand, Yes you have alot of variables. But!, You have a program that is doing an awful lot of work in one shot. Try doing this work without a program. What you are trying to accomplish is wonderful. So pursue your goal. Take it one variable at a time. Do not get overwhelmed with the size of the project. The reason I did all those Select One... is that there may not be a component related to that group. That way if there are only 3 compressors then you do not touch comp4 or 5, it will not display those units. What I want to do is have a radio button for each unit, "yes or no"...
The if yes, all other selections are made available, if no, it turns them "off" and possibly "greys out" or disables the selection.
There is another way to accomplish this, But is abit more involved. I would have to write you another example on how to do this. What you would need to do is extract only certain info from your list based on certain criteria.
I believe there are other threads by ASMI and Lee Mac on this subject to extract list items.
View this thread and the program and watch what happens to the lists when certain radio buttons are selected.
http://www.cadtutor.net/forum/showthread.php?t=34891 I am also using a lazy button, to reset all layers and restart the app upon error or redo.
Kinda sloppy, but it works.
I will work on your recall method.
Thanks a TON.
I am also going to start commenting off to the side as you do.
Much easier to follow.
Did you run the program from the thread I pointed out to you?
Did you notice what happened to the lists?
I think this is what you may be after.
I believe you have the smarts to tackle this.
It is upto to you to decide whats best for your program.
I am just giving you a push in a certain direction. yes I did run it and noticed that depending on the selection (interior door, cabinet door etc), the list choices change. Interesting.
What ya think about this?
If Comp Qty is picked at 2, then default 3 4 & 5 to blank values, or maybe a "dash".
If the value is blank, the layers are turned off.
http://slimpickinz.com/images/comp-pid.jpg
-SlimP
页:
1
[2]