Jump to content

Selection Set with filtertype 10,20 and 30


jwitteman

Recommended Posts

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 by jwitteman
Link to comment
Share on other sites

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...

Link to comment
Share on other sites

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

Link to comment
Share on other sites

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.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...