Author Topic: ssget function with initget function  (Read 2291 times)

0 Members and 1 Guest are viewing this topic.

Coder

  • Swamp Rat
  • Posts: 827
ssget function with initget function
« on: June 23, 2013, 08:44:58 AM »
Hello Guys .  :-)

Is it possible to use the function ssget with the initget to call a dialog if the user typed d or dialog , otherwise keep the ssget function active to select lines ?

Code: [Select]
(princ "\n Select Lines or [Dialog] :")
(initget "Dialog")
(if (setq sel (ssget '((0 . "LINE"))))
  (progn
    ............
    )
  )

Thanks in advance .

ribarm

  • Gator
  • Posts: 3279
  • Marko Ribar, architect
Re: ssget function with initget function
« Reply #1 on: June 23, 2013, 09:45:39 AM »
What comes to mind, something like this :

Code: [Select]
(defun c:_sel ( / sel )
  (initget "Dialog")
  (if (eq (getkword "\n Select Lines or [Dialog] :") nil)
    (progn
      (setq sel (ssget '((0 . "LINE"))))
      ...
    )
    (progn
      (initdia)
      ...
    )
  )
  (princ)
)
Marko Ribar, d.i.a. (graduated engineer of architecture)

:)

M.R. on Youtube

CAB

  • Global Moderator
  • Seagull
  • Posts: 10401
Re: ssget function with initget function
« Reply #2 on: June 23, 2013, 02:58:44 PM »
Use a subroutine to get the entry & then process as you like.
http://www.theswamp.org/index.php?topic=39042.msg442350#msg442350
« Last Edit: June 24, 2013, 08:01:21 AM by CAB »
I've reached the age where the happy hour is a nap. (°¿°)
Windows 10 core i7 4790k 4Ghz 32GB GTX 970
Please support this web site.

Coder

  • Swamp Rat
  • Posts: 827
Re: ssget function with initget function
« Reply #3 on: June 24, 2013, 12:57:22 AM »
Thank you ribarm and CAB .

Still not what I am after  :embarrassed:

Lee 's function is a single selection set and I need to get the benefit of the ssget to select many lines .

My goal is to have a function that can do the same like below example but with ssget to be able to select many lines in one shut .

Code: [Select]
(initget "Dialog")
(if (setq sel (entsel "\n Select Lines or [Dialog] :"))
 
  (if (eq sel "d")
    (showDialog)
    (..........)
      )
  )
       

roy_043

  • Water Moccasin
  • Posts: 1895
  • BricsCAD 18
Re: ssget function with initget function
« Reply #4 on: June 24, 2013, 03:01:16 AM »
Code - Auto/Visual Lisp: [Select]
  1. (princ "\n Select lines or Enter for dialog :")
  2. (if (setq sel (ssget '((0 . "LINE"))))
  3.   (progn
  4.     ............
  5.   )
  6.   (showDialog)
  7. )