PDA

View Full Version : Previous selection sets



LT.Seabee
2004-08-03, 02:01 PM
Didn't at one time Express tools have a feature that would allow you pick a previous selection set? If not, then someone else had created such an animal. Does anyone have an idea of where I might could find such a thing or go about creating it?

If I were to create it, how would I store the selection sets and cycle them?

Thanks!
Harvey

Wanderer
2004-08-03, 02:14 PM
Didn't at one time Express tools have a feature that would allow you pick a previous selection set? If not, then someone else had created such an animal. Does anyone have an idea of where I might could find such a thing or go about creating it?

If I were to create it, how would I store the selection sets and cycle them?

Thanks!
Harvey
Not sure if any of these will work (from the exchange)
EX001018 (javascript:OpenSubmission('EX001018')) AcadX_SelectSets.zip - A set of VB(A) routines for creating & filtering selection sets
EX001046 (javascript:OpenSubmission('EX001046')) SSetToNamedSS.lsp - AutoLISP file converts selection set into named ActiveX selection set

msjca
2004-08-09, 06:50 PM
If you have selected something(s) and want to save that selection to use later, you could use the group command to make it into a group.


Alternativley, at the command prompt you could type
(setq selection1 (ssget "P"))
Then, in response to any "Select objects" prompt, you can type
!selection1
(exclamation prefaces the name of your selection set) and the objects in that selection will be selected/highlighted.

From AutoLISP you could move via (command "m" selection1 "" pt1 pt2) for example. Obviously you don't have to name you selection "selection1", name it whatever you choose and you can have as many saved selection sets as you want, like S1, S2, etc. eh.

The point is, after finishing a selection, if you save the previous selection (as indicated above) before selecting any other objects, you can recall that selection later.

(It may not be practical to automatically save selection sets as you edit (via reactors for example) as this may soon use much memory. It would be an effort, but such a routine could be created and selection sets accessed via a dialog box, but figuring which selection you wish to retreive might be difficult. Other problems may arise due to deleted items which were part of a set, etc.

sinc
2004-08-11, 02:18 AM
Be careful with this approach. It should be OK if used sparingly.

From the on-line documentation:


Attempting to manage a large number of selection sets simultaneously is not recommended. An AutoLISP application cannot have more than 128 selection sets open at once. (The limit may be lower on your system.) When the limit is reached, AutoCAD refuses to create more selection sets. Keep a minimum number of sets open at a time, and set unneeded selection sets to nil as soon as possible. If the maximum number of selection sets is reached, you must call the gc function to free unused memory before another ssget will work.

jwanstaett
2004-08-11, 01:23 PM
I have two buttons in my popup menu that i use when I need to save a selection set. One save the selection sets to S1 the other save to S2.

After saveing the selection when prompt for Seclect Object I enter !S1 or !S2 to recall the saved selection set . If you need to you can add more.




code in my menu
--------------------------------------------------
[SAVE S1]^C^C(SETQ S1(SSGET))
[SAVE S2]^C^C(SETQ S2(SSGET))
-------------------------------------------------