PDA

View Full Version : Selection Set with filtertype 10,20 and 30



jwitteman
18th Nov 2010, 11:21 am
Hello, I want to select two types of blocks in my drawing with an insertion point somewhere between (let's say) -10,-10,0 and 10,10,0

The following code is working (without the insertion-point-part)



Dim ssNew as acadselectionset
set ssNew = thisdrawing.selectionsets.add("newset")

Dim FilterType(0 to 2) as integer
Dim FilterData(0 to 2) as variant

FilterType(0) = 0: FilterData(0) = "INSERT"
FilterType(1) = 2: FilterData(1) = "Blockname1, Blockname2"
FilterType(2) = 67: FilterData(2) = 0 'only modelspace...

ssNew.Select acSelectionSetAll, , , FilterType, FilterData

Adding the point -10,-10,0 and 10,10,0 right into the Select part won't work, because then the whole block needs to be in that area and I want just the insertion point. So somethjing with

FilterType(3) = 10: FilterData(3) = >=-10 and <=10 or something like that...

Anywone an idea?

Thanks in advance.

jwitteman
18th Nov 2010, 03:08 pm
Ok, Found out the following isue...



Dim ssNew as AcadSelectionSetset ssNew = ThisDrawing.Selectionsets.add("newset")

Dim dblPoint(0 to 2) as double
dblPoint(0) = 0: dblPoint(1) = 0: dblPoint(2) = 0

Dim FilterType(0 to 3) as integer
Dim FilterData(0 to 3) as variant

FilterType(0) = 0: FilterData(0) = "INSERT"
FilterType(1) = 2: FilterData(1) = "Blockname1, Blockname2"
FilterType(2) = 67: FilterData(2) = 0 'only modelspace...
FilterType(3) = 10: FilterData(3) = dblPoint

ssNew.Select acSelectionSetAll, , , FilterType, FilterData


With this code I get the block that has insertion point exactly the same as dblPoint. But what I want is not only the point, but a window of points...

BIGAL
19th Nov 2010, 06:35 am
Just pick all blocks and then step through them and check there insertion point if it falls within your window, maybe rather than trying to filter in selection.


For Cntr = 0 To SSnew.Count - 1
xmin < xblock > xmax and ymin < yblock > ymax true = within window Then do something