... If the index argument is not supplied, this function returns a list containing the entity names of the elements in the selection set, along with data that describes how each entity was selected.
_$ (setq ss (ssget "_X"))
<Selection set: 150b>
_$ (sslength ss)
6251
_$ (QuickBench '((LM:ss->ent ss) (slow:ss->ent ss)))
Benchmarking .. done for 128 iterations. Sorted from fastest.
Statement Increment Time(ms) Normalize Relative
--------------------------------------------------------------------------------
(LM:SS->ENT SS) 128 1325 1325 3.35
(SLOW:SS->ENT SS) 32 1109 4436 1.00
--------------------------------------------------------------------------------
More than 3 times as slow.
@ FREQUENCYDRIVE:
You should read the Help regarding ssnamex:Quote from: http://docs.autodesk.com/ACD/2011/ENU/filesALR/WS1a9193826455f5ff1a32d8d10ebc6b7ccc-6933.htm... If the index argument is not supplied, this function returns a list containing the entity names of the elements in the selection set, along with data that describes how each entity was selected.
(vl-remove-if 'listp (mapcar 'cadr (ssnamex (ssget))))
(foreach ent (vl-remove-if 'listp (mapcar 'cadr (ssnamex (ssget))))
code here but not shown
);end foreach
You might find this program useful:
http://lee-mac.com/entitylist.html (http://lee-mac.com/entitylist.html)
This ... ?Code - Auto/Visual Lisp: [Select]
(ssget "_+.:S"
I have the autolisp reference manual (1992) that I got from an old'timer at work. I assume those characters after ssget "_+.:S" are filters of some sort. I'll have to dig into that more. Off to the online help to figure out what that means.You might find this program useful:Lee you have a nice website. I love the mathematics section. I just bookmarked it. I'll be back there often for sure.
http://lee-mac.com/entitylist.html (http://lee-mac.com/entitylist.html)
I don't understand this part:Code: [Select](ssget "_+.:S"
I have the autolisp reference manual (1992) that I got from an old'timer at work. I assume those characters after ssget "_+.:S" are filters of some sort.
":S" As stated in the Visual LISP IDE Help Documentation, this mode string forces single object selection only.
:S Allow single selection only.
":S" As stated in the Visual LISP IDE Help Documentation, this mode string forces single object selection only.Quote from: http://docs.autodesk.com/ACD/2011/ENU/filesALR/WS1a9193826455f5ff1a32d8d10ebc6b7ccc-693e.htm:S Allow single selection only.
I have been told that "single selection" should be interpreted as "single selection PASS" not as "single OBJECT selection". A single selection pass means the user can select only once, but if a window or crossing is used multiple objects can be selected. Which explains why "+." is required.
FREQUENCYDRIVE
This is an old routine you may want to take a look at.
http://www.theswamp.org/index.php?topic=1173.0
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.
However, there are numerous other undocumented ssget mode strings and so, to benefit both you and the community, I have attached all of the information that I have collected on the ssget function from various sources.
« Edited to correct erroneous description of ":S", as stated in Reply #11 (http://www.theswamp.org/index.php?topic=42316.msg474866#msg474866) »
If some of those are undocumented how did you ever find out about them?
Again thank you for the file you uploaded. You really are doing a service to the rest of us on here struggling to learn lisp and Autocad. The same goes for CAB.