TheSwamp
Code Red => AutoLISP (Vanilla / Visual) => Topic started by: Coder on September 24, 2019, 10:37:49 AM
-
Hello guys.
I would like to have a dialog box with my routine but the program uses ssget function at the start up.
I know that I can have the dialog appears every time I run the program but I do prefer to call the dialog once required only.
(initget "Dialog")
(setq ss (ssget '((0 . "INSERT")))) ;; type D then show the dialog but this does not work.
Thank you in advance.
-
You need to post the whole code for anyone to debug it. You didn't even show a "getkword" call, how were you expecting a dialog box to pop up?
-
No codes yet but I am trying to use the same concept of the command SETBYLAYER although I don't think the getkword function works in this example and I could be wrong.
Thank you.
-
Initget works with a number of get* functions (not just with getkword) and the entsel, nentsel and nentselp functions. But not with ssget.
-
Initget works with a number of get* functions (not just with getkword) and the entsel, nentsel and nentselp functions. But not with ssget.
Yes, you are right.
I wonder how does the command SETBYLAYER work with ssget ! :reallysad:
-
As Roy has correctly stated, ssget does not support custom keywords defined by initget, as it already offers a set of keywords representing selection methods. One alternative option is to roll your own selection function (https://www.theswamp.org/index.php?topic=34804) so that you can test for your own defined keywords, or alternatively use a response of ENTER to select a default option and allow the user to exit the selection prompt using ESC (this is the method I opted to use in my Nested Block Counter (http://lee-mac.com/nestedblockcounter.html) program).
-
Thanks Lee for your kind reply.
-
If you just want say known keywords then something like this could be used.
(if (not AH:Butts)(load "Multi Radio buttons.lsp"))
(if (= but nil)(setq but 1))
(setq ans (ah:butts but "V" '("Pick type " "Insert" "Line" "Arc" "Circle"))) ; ans holds the button picked value
(setq ss (ssget (list (cons 0 ans))))