jwitteman Posted November 18, 2010 Share Posted November 18, 2010 (edited) 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 Anywone an idea? Thanks in advance. Edited November 18, 2010 by jwitteman Quote Link to comment Share on other sites More sharing options...
jwitteman Posted November 18, 2010 Author Share Posted November 18, 2010 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... Quote Link to comment Share on other sites More sharing options...
BIGAL Posted November 19, 2010 Share Posted November 19, 2010 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 xmax and ymin ymax true = within window Then do something Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.