PDA

View Full Version : How to access AutoCAD selection sets



venablescranes
2005-02-19, 05:08 AM
Hello,
New to ACAD, VBA and AUGI...
I want to be able to reuse a selection set I have made in AutoCAD ie. I select lots of thing and then later want to select them all again.
Is there an AutoCAD command for this?
If not is this selection set stored in the AutoCAD db and can I access it from VBA?
The selection sets in VBA seem to only be ones that you create thru VBA?
Also started looking at EVents - was going to store Items selected as I left click them BUT there doesn't seem to be a left click event . Is that right ???? Doesn't seem to be many events at all??
Hope this makes sence to someone.
Have a nice day.
Roger.

san_k4
2005-02-19, 08:07 AM
One way of reselecting the entities is to store the handles of the entities you have selected ,store them either 1)in an external file(text,excel,access)./as xrecords within the drg.And later when you require it select the entities by using ‘handle to object method’. using the list of entity handles u have stored earlier. Right now I don’t have the code. But there is plenty of codes available in bits and pieces in acad help/net. tie them up logically to achieve your objective.hope this helps..
Regards,

santhosh

lance.81922
2005-02-20, 11:34 PM
One thing you can do is to create your selection set with (ssget), and then pass it to the SELECT command:

(setq sset(ssget [however you want to do this...])
(command "_SELECT" sset "")

This will allow you to use the "Previous" option if you next want to MOVE or COPY your selection set.

The same general technique should work with VBA, although creating the selection set is actually more challenging than in AutoLISP.