Author Topic: initget with ssget  (Read 271 times)

0 Members and 1 Guest are viewing this topic.

Coder

  • Swamp Rat
  • Posts: 771
initget with ssget
« 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.

Code: [Select]
(initget "Dialog")
(setq ss (ssget '((0 . "INSERT")))) ;; type D then show the dialog but this does not work.

Thank you in advance.
« Last Edit: September 24, 2019, 10:52:39 AM by Coder »

tombu

  • Newt
  • Posts: 154
  • ByLayer=>Not0
Re: initget with ssget
« Reply #1 on: September 24, 2019, 11:23:36 AM »
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?
Tom Beauford P.S.M.
Leon County FL Public Works - Windows 7 64 bit AutoCAD Civil 3D

Coder

  • Swamp Rat
  • Posts: 771
Re: initget with ssget
« Reply #2 on: September 24, 2019, 11:27:33 AM »
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.

roy_043

  • Water Moccasin
  • Posts: 1720
  • BricsCAD 18
Re: initget with ssget
« Reply #3 on: September 24, 2019, 01:05:12 PM »
Initget works with a number of get* functions (not just with getkword) and the entsel, nentsel and nentselp functions. But not with ssget.

Coder

  • Swamp Rat
  • Posts: 771
Re: initget with ssget
« Reply #4 on: September 24, 2019, 01:09:40 PM »
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:

Lee Mac

  • Seagull
  • Posts: 12267
  • London, England
Re: initget with ssget
« Reply #5 on: September 24, 2019, 04:43:07 PM »
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 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 program).

Coder

  • Swamp Rat
  • Posts: 771
Re: initget with ssget
« Reply #6 on: September 25, 2019, 04:41:28 AM »
Thanks Lee for your kind reply.

BIGAL

  • Bull Frog
  • Posts: 317
  • 30 + years of using Autocad
Re: initget with ssget
« Reply #7 on: September 25, 2019, 11:10:54 PM »
If you just want say known keywords then something like this could be used.

Code: [Select]
(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))))
A man who never made a mistake never made anything