Display full version of the post: using a selection

vetlel
13.08.2007, 16:51
Hello all,I have written a macro many years ago that uses surfaces in a user selectable layer, and processes these surfaces through loads of complicated code.Seeing it is years ago, and i got a little rusty in the mean time:Is it possible for a macro to use the selection you made on the screen in autocad instead of a layer?I hope my question is clear...Any pointers would be greatly appreciatedPatrick.

Vladimir Michl
13.08.2007, 17:07
Was it a LISP macro?
 
The object selection function - (ssget) - has a lot of options allowing to select interactively, by layer, or by other properties, plus combinations of these.
 
E.g.:
(ssget '((0 . "CIRCLE"))) -- selects all circles in user selected objects
(ssget "_X" '((0 . "CIRCLE"))) -- selects all circles in the whole drawing
(ssget "_X" '((8 . "MYLAYER"))) -- selects all objects in the MYLAYER layer
(ssget "_W") -- starts a plain window-selection
etc.

vetlel
13.08.2007, 17:45
Mmmm, lisp? lost me there.It is some code written for autocad 2002 (MDT6)Here is a small part of the code i have:<code>                    intCodes(0) = 0                    varCodeValues(0) = "assurface"                    ' Layer selection                    intCodes(1) = 8                    varCodeValues(1) = ComboBoxlayer.Text                    surfacesSS.Select acSelectionSetAll, , , intCodes, varCodeValues</code>What it does now, is that it selects all the entities that correspond with certain criterias in the layer you tell it to look.I would like it to do the same but now not looking in a certain layer, but selecting within a selection you made in autocad (when it turns blue)Hope i explained myself a little better now...

Vladimir Michl
13.08.2007, 18:04
Aha - not LISP but VBA.
You can try:
SurfacesSS.SelectOnScreen

vetlel
13.08.2007, 18:11
Cheers!I came around that, but for some reason it didn't work.But at least i know i am on the right track now...I will keep you posted how things turn out.