Author Topic: LM:ssget  (Read 2973 times)

0 Members and 1 Guest are viewing this topic.

amc.dicsac

  • Newt
  • Posts: 109
  • Autocad 2008
LM:ssget
« on: April 13, 2016, 05:27:48 PM »
Hello such, someone who can explain to me how I can make a (ssget "_: L") but with the LM func: Mac Lee SSGET

Thank you

Code: [Select]
;; Un contenedor para la función ssget para permitir el uso de un mensaje de selección personalizada
;; argumentos:
;; msg - mensaje de selección
;; params - lista de argumentos ssget
   (vl-load-com)
   (defun LM:ssget ( msg params / sel )
       (prompt msg)
       (setvar 'nomutt 1)
       (setq sel (vl-catch-all-apply 'ssget params))
       (setvar 'nomutt 0)
       (if (not (vl-catch-all-error-p sel))
           sel
       )
)
<a href="http:/http://axprogramlisp.blogspot.pe" class="bbc_link" target="_blank">By Alexander Castro</a>

Lee Mac

  • Seagull
  • Posts: 12914
  • London, England
Re: LM:ssget
« Reply #1 on: April 13, 2016, 06:13:02 PM »
Example:
Code - Auto/Visual Lisp: [Select]
  1. ;; ssget  -  Lee Mac
  2. ;; A wrapper for the ssget function to permit the use of a custom selection prompt
  3. ;; msg - [str] selection prompt
  4. ;; arg - [lst] list of ssget arguments
  5.  
  6. (defun LM:ssget ( msg arg / sel )
  7.     (princ msg)
  8.     (setvar 'nomutt 1)
  9.     (setq sel (vl-catch-all-apply 'ssget arg))
  10.     (setvar 'nomutt 0)
  11.     (if (not (vl-catch-all-error-p sel)) sel)
  12. )
Code - Auto/Visual Lisp: [Select]
  1. (LM:ssget "\nSelect objects on unlocked layers: " '("_:L"))

amc.dicsac

  • Newt
  • Posts: 109
  • Autocad 2008
Re: LM:ssget
« Reply #2 on: April 13, 2016, 06:31:30 PM »
and if you want to add (ssget "_: L" (list (cons 0 "insert")))
<a href="http:/http://axprogramlisp.blogspot.pe" class="bbc_link" target="_blank">By Alexander Castro</a>

ChrisCarlson

  • Guest
Re: LM:ssget
« Reply #3 on: April 14, 2016, 07:51:43 AM »
It's incredibly annoying that you keep blatantly removing the credits to routines you use. So quit it.

Lee, curious to what instance this wrapper would be better suited than select-if?
« Last Edit: April 14, 2016, 07:56:45 AM by ChrisCarlson »

Lee Mac

  • Seagull
  • Posts: 12914
  • London, England
Re: LM:ssget
« Reply #4 on: April 14, 2016, 08:48:59 AM »
Lee, curious to what instance this wrapper would be better suited than select-if?

select-if uses entsel/nentsel and therefore only permits a single selection, the above function enables full ssget functionality whilst allowing a custom selection prompt.

MPD

  • Mosquito
  • Posts: 5
Re: LM:ssget
« Reply #5 on: January 24, 2024, 04:53:52 AM »
what if i want
(LM:ssget "\nSelect Pline to Update: " '("_:S") '((0 . "LINE,SPLINE,LWPOLYLINE,POLYLINE,ARC,CIRCLE,ELLIPSE")))

Lee Mac

  • Seagull
  • Posts: 12914
  • London, England
Re: LM:ssget
« Reply #6 on: January 24, 2024, 07:34:44 AM »
what if i want
(LM:ssget "\nSelect Pline to Update: " '("_:S") '((0 . "LINE,SPLINE,LWPOLYLINE,POLYLINE,ARC,CIRCLE,ELLIPSE")))

Use -
Code - Auto/Visual Lisp: [Select]
  1. (LM:ssget "\nSelect Pline to Update: " '("_:S" ((0 . "LINE,SPLINE,LWPOLYLINE,POLYLINE,ARC,CIRCLE,ELLIPSE"))))

saunambon654

  • Mosquito
  • Posts: 13
Re: LM:ssget
« Reply #7 on: February 20, 2024, 08:17:13 PM »
Can I use it with (initget function, be like this:
Code: [Select]
(initget "First Second")
(setq ss (LM:ssget "\nSelect Pline to Update [First/Second]: " '(((0 . "LINE,SPLINE,LWPOLYLINE,POLYLINE,ARC,CIRCLE,ELLIPSE")))))

kdub_nz

  • Mesozoic keyThumper
  • SuperMod
  • Water Moccasin
  • Posts: 2140
  • class keyThumper<T>:ILazy<T>
Re: LM:ssget
« Reply #8 on: February 20, 2024, 09:49:11 PM »
@ saunambon654

Have you tried  ( tested ) that option. ??

Called Kerry in my other life
Retired; but they dragged me back in !

I live at UTC + 13.00

---
some people complain about loading the dishwasher.
Sometimes the question is more important than the answer.

saunambon654

  • Mosquito
  • Posts: 13
Re: LM:ssget
« Reply #9 on: February 21, 2024, 01:45:55 AM »
Yes, I hvae tried it.
When I entered "F", it became changing to "Fence" of ssget function.
When I entered "S", it was no change and continued to select object.
So I wonder is there any right way to use with (initget function.

Lee Mac

  • Seagull
  • Posts: 12914
  • London, England
Re: LM:ssget
« Reply #10 on: February 21, 2024, 05:42:17 AM »
No - you cannot use initget with ssget.

BIGAL

  • Swamp Rat
  • Posts: 1417
  • 40 + years of using Autocad
Re: LM:ssget
« Reply #11 on: February 21, 2024, 10:56:15 PM »
You can build a what filter to use it makes the string that is used in the ssget a 2 step process. This uses a program I have to make choices.



Code: [Select]
(princ str)
 "Line,Arc"
(setq ss (ssget '((cons 0 str))))
A man who never made a mistake never made anything

saunambon654

  • Mosquito
  • Posts: 13
Re: LM:ssget
« Reply #12 on: February 23, 2024, 10:30:55 PM »
No - you cannot use initget with ssget.
Thank you Lee! Is there any way to do that without (initget function? Could you please make the sample?

Lee Mac

  • Seagull
  • Posts: 12914
  • London, England
Re: LM:ssget
« Reply #13 on: February 26, 2024, 06:02:26 AM »
No - you cannot use initget with ssget.
Thank you Lee! Is there any way to do that without (initget function? Could you please make the sample?

Not without writing your own version of ssget.