PDA

View Full Version : Am I correct in thinking there is no hatch collection



cgerhardt
2006-06-17, 06:25 PM
Am I correct in thinking there is no hatch collection?

I want create a combo box filled with hatches used in the drawing. I guess I'll just have to iterate through all the entities in the drawing to compile a list of them.

zoomharis
2006-06-17, 08:21 PM
Am I correct in thinking there is no hatch collection?
I think your guess is correct (As far as I know).


I want create a combo box filled with hatches used in the drawing. I guess I'll just have to iterate through all the entities in the drawing to compile a list of them.
Instead of iterating through all the entities in the drawing, you can create a selection set of hatch objects using the filter options (using DXF code/value pair) provided with the selection methods of SelectionSet object.

Just a few lines of sample code for your reference...



Dim objSSet As AcadSelectionSet
Set objSSet = ThisDrawing.SelectionSets.Add("HatchSet")
Dim gpCode(0) As Integer: Dim dataVal(0) As Variant
gpCode(0) = 0
dataVal(0) = "HATCH"
objSSet.Select acSelectionSetAll, , , gpCode, dataVal


That gives you a selection set of all hatch entities used in the drawing.

HTH
har!s

Jeff_M
2006-06-17, 09:06 PM
That gives you a selection set of all hatch entities used in the drawing.
.....but if you want the ones contained in hatches as well, you'd need to iterate all of the non-layout blocks.

zoomharis
2006-06-18, 01:18 PM
.....but if you want the ones contained in hatches as well, you'd need to iterate all of the non-layout blocks.
Thanks Jeff, for the input .

har!s