the filters can be simplified:
gpCode(0) = 0: dataValue(0) = "LINE,HATCH"
gpCode(1) = 62: dataValue(1) = 6
If you group like Objects into the same string, seperated by a comma it
implies OR
The SS function uses AND unless told otherwise. So the filters above will be
read by the SS function as "If an object is a Line OR Hatch, AND it is the
color 6, include it.
When filtering for specific layers, you can do the same thing:
gpcode(0) = 8: dataValue(0) = "0,Layer1,Layer2"
HTH,
Jeff
"Tom Roberts"
wrote in message
news:4931798@discussion.autodesk.com...
Hello Bernard
To loop thro' a selection use something like the following:
Dim Ent As AcadEntity
Dim SS As AcadSelectionSet
For Each Ent In SS
'do something here...ie change colour
Ent.color = acCyan
Next Ent
To include hatches you need to add the OR operator to your selectionset
filter. You have got a filter working haven't you???
If not it looks something like this:
'set up filter data
gpCode(0) = -4: dataValue(0) = "
gpCode(1) = -4: dataValue(1) = "
gpCode(2) = 0: dataValue(2) = "LINE" 'filter for line
entities...
gpCode(3) = 0: dataValue(3) = "HATCH" 'or hatched entities...
gpCode(4) = -4: dataValue(4) = "OR>" 'close OR operator
gpCode(5) = 62: dataValue(5) = "6" 'that are colour magenta
(6)
gpCode(6) = -4: dataValue(6) = "AND>" 'close AND operator
Did you look up selection methods in the help file at all...
If you want to select via a window when your program will provide the window
coords use the SELECT method of the SelectionSet object.
If you want the User to enter the window use the SelectOnScreen method of
the SelectionSet object.
Both methods accept the filter as a parameter.
Keep at it. If you have any more problems post some code and will get it
nutted
--
Regards
Tom Roberts
__________________________
MechWest Design & Drafting
Perth, Western Australia
wrote in message news:4930933@discussion.autodesk.com...
Having a hard time looping through selection set and I want to also include
hatches.
Also, what's the line of code that asks for user to input a selection box
(upper left corner to lower right corner)
Bernard