Im not sure if Im saying that right. I use this little snippet of code in a lot of programs (with different lists of course depending on the program). As I understand it, the part that reads <POOL> and ("POOL") define the default choice in the display and the selection. Ive removed those and there is no default, you must select something. What I want to know is if there is a way to use that part of the code to make the selection whatever the last selection was, instead of a defined default or none. Thank you
(IF (NULL TYP)
(PROGN (INITGET "POOL SPA THERAPY WTR-FEATURE")
(SETQ TYP (COND ((GETKWORD "\nSpecify Layer [POOL/SPA/THERAPY/WTR-FEATURE] <POOL>: "))
("POOL")
)
)
)
)
Solved! Go to Solution.
Solved by CodeDing. Go to Solution.
@murmanator wrote:
.... I ran into some trouble awhile back NOT using all caps where I had multiple options with the same first letter. I had to cap the second/third letters for it all to work right (there needed to be unique capitalized letters leading off each word) . ....
You don't need unique leading letters, but can capitalize just the first two letters, if that helps, or three if needed, etc. And you can use just the first letter for the more likely option that starts with it, and more letters for the less likely ones as needed. Like the LOck option in a command-line -LAYER command, distinguished by use of two letters from the Ltype option that uses the L alone.
If you try my multi Radio buttons.lsp you can use the But value to the last picked button, it is not documented but in the code it uses the global value BUT to choose which radio button to highlight. Ok now part 2 you can save in your dwg the value of BUT using the Ldata function so when you open the dwg again you can search for the value of BUT if not found that means code has not been ran so uses default of 1.
(if (not AH:Butts)(load "Multi radio buttons.lsp")) ; loads the program if not loaded already
(setq ahdef (vlax-ldata-get "MURM" "AHDEF" ) )
(if (= ahdef nil)(setq ahdef 1)) ; this is needed to set default button
(setq ans (ah:butts ahdef "V" '("Please choose " "Pool" "Spa" "Therapy" "Water-feature" )))
(setq ahdef but)
(vlax-ldata-set "MURM" "AHDEF" but)
Can't find what you're looking for? Ask the community or share your knowledge.