Author Topic: How to select a named group with (ssget "_G" ...)?  (Read 4359 times)

0 Members and 1 Guest are viewing this topic.

roy_043

  • Water Moccasin
  • Posts: 1895
  • BricsCAD 18
How to select a named group with (ssget "_G" ...)?
« on: September 21, 2017, 09:34:36 AM »
I can't seem to find any useful information on the "G" keyword of the ssget function.
What is the correct syntax?
Code: [Select]
(ssget "_G" ...)
Note: I know how to approach this via the namedobjdict.

VovKa

  • Water Moccasin
  • Posts: 1629
  • Ukraine
Re: How to select a named group with (ssget "_G" ...)?
« Reply #1 on: September 21, 2017, 09:55:55 AM »
are you sure that ssget supports "_G" keyword?

Marc'Antonio Alessi

  • Swamp Rat
  • Posts: 1451
  • Marco
Re: How to select a named group with (ssget "_G" ...)?
« Reply #2 on: September 21, 2017, 10:51:31 AM »


G  Groups
   Selects all objects within a specified Group.


Ssget options:


  A  All
  B  Box
  C  Crossing
 CP  Crossing Polygon
  : D  Duplicates OK
 :E  Everything in aperture
  F  Fence
  G  Groups
  I  Implied
  L  Last
 :L  Rejects locked layers
  M  Multiple
 :N  Nested
  P  Previous
  : P Rejects Viewport
 :R Allows entities in a long transaction to be selected.
 :S  Force single object selection only
 :U Enables subentity selection - 2006+
 :V Forces subentity selection - 2006+
  W  Window
 WP  Window Polygon
  X  Extended search (search whole database)
+. Point Selection Mode


The string "_+.:S" is a combination of a number of ssget mode strings, each component of which has a different meaning:
"_" (underscore) allows for variation in language; prefixing mode string operators with an underscore forces
the English version.
"+." This undocumented mode string forces ssget to remain in 'point' mode, similar to setting PICKAUTO to 0.
":S" As stated in the Visual LISP IDE Help Documentation, this mode string forces a single selection, that is,
the user may attempt to select a number of objects only once. When combined with the "+." mode string, this
forces a single object selection.

Lee Mac

  • Seagull
  • Posts: 12913
  • London, England

Marc'Antonio Alessi

  • Swamp Rat
  • Posts: 1451
  • Marco
Re: How to select a named group with (ssget "_G" ...)?
« Reply #4 on: September 21, 2017, 01:21:10 PM »


see: https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/ssget-quot-g-quot-syntax/td-p/828577
thanks Lee I completely forgot about that discussion, other mysteries:
Code: [Select]
Comando: (ssget "g") nil
Comando: (ssget "-g") Selezionare oggetti: 

Comando: (ssget "-x") Selezionare oggetti:
Comando: (ssget "xa") ; errore: stringa in modalità ssget errata
Comando: (ssget "xb") ; errore: stringa in modalità ssget errata
Comando: (ssget "xc") ; errore: argomento punto errato
Comando: (ssget "xd") ; errore: stringa in modalità ssget errata
Comando: (ssget "xe") ; errore: stringa in modalità ssget errata
Comando: (ssget "xf") <Selection set: 100>
Comando: (ssget "xg") <Selection set: 102>
Comando: (ssget "xh") ; errore: stringa in modalità ssget errata
Comando: (ssget "xi") <Selection set: 105>
Comando: (ssget "xj") ; errore: stringa in modalità ssget errata
Comando: (ssget "xk") ; errore: stringa in modalità ssget errata
Comando: (ssget "xm") <Selection set: 109>...

roy_043

  • Water Moccasin
  • Posts: 1895
  • BricsCAD 18
Re: How to select a named group with (ssget "_G" ...)?
« Reply #5 on: September 21, 2017, 01:43:53 PM »
Thanks for your answers.
The latest documentation mentions that "G" has to be combined with "+" or "-".

Lee Mac

  • Seagull
  • Posts: 12913
  • London, England
Re: How to select a named group with (ssget "_G" ...)?
« Reply #6 on: September 21, 2017, 01:47:50 PM »
It seems that they've updated the documentation significantly... :-o

ronjonp

  • Needs a day job
  • Posts: 7527
Re: How to select a named group with (ssget "_G" ...)?
« Reply #7 on: September 21, 2017, 03:56:10 PM »
It seems that they've updated the documentation significantly... :o
They probably got most of it from your site.  >:D

Windows 11 x64 - AutoCAD /C3D 2023

Custom Build PC

Lee Mac

  • Seagull
  • Posts: 12913
  • London, England
Re: How to select a named group with (ssget "_G" ...)?
« Reply #8 on: September 21, 2017, 05:39:58 PM »
It seems that they've updated the documentation significantly... :o
They probably got most of it from your site.  >:D

 :-D

Marc'Antonio Alessi

  • Swamp Rat
  • Posts: 1451
  • Marco
Re: How to select a named group with (ssget "_G" ...)?
« Reply #9 on: September 22, 2017, 02:36:04 AM »

Thanks for your answers.
The latest documentation mentions that "G" has to be combined with "+" or "-".
Code: [Select]
From: http://help.autodesk.com/view/OARX/2018/ENU/?guid=GUID-0F37CC5E-1559-4011-B8CF-A3BA0973B2C3

;; Remove the Multiple and All selection modes

(ssget "-M-A")
Select objects: ?
*Invalid selection*
Expects a point or Window/Last/Crossing/BOX/Fence/WPolygon/CPolygon/Group/Add/Remove/Previous/Undo/AUto/SIngle
---------------------------------------
Tested in 2013:
Comando: (ssget "-M-A") ; errore: stringa in modalità ssget errata
Comando: (ssget "-_M-_A"); errore: stringa in modalità ssget errata
Comando: (ssget "_-M_-A") ; errore: stringa in modalità ssget errata
-g works:
Comando: (ssget "-g")
Selezionare oggetti: ?
*Selezione non valida*
Richiede un punto o Finestra/Ultimo/Interseca/Riquadro/Tutto/iNTercetta/FPoligono/IPoligono/AGgiungi/Elimina/Multiplo/Precedente/Annulla/AUto/SIngolo
Comando: (ssget)
Selezionare oggetti: ?
*Selezione non valida*
Richiede un punto o Finestra/Ultimo/Interseca/Riquadro/Tutto/iNTercetta/FPoligono/IPoligono/Gruppo/AGgiungi/Elimina/Multiplo/Precedente/Annulla/AUto/SIngolo

Marc'Antonio Alessi

  • Swamp Rat
  • Posts: 1451
  • Marco
Re: How to select a named group with (ssget "_G" ...)?
« Reply #10 on: September 22, 2017, 03:04:21 AM »

Maybe need something like this:  :wideeyed2:
Comando: (ssget "_g" '((2 . "GroupName")))

nil


Comando: (ssget "_g" '((310 . "GroupName")))
; errore: carattere non valido nel gruppo 1004