Author Topic: Problem with Selection Set Filter - VB.NET  (Read 1897 times)

0 Members and 1 Guest are viewing this topic.

gablackburn

  • Guest
Problem with Selection Set Filter - VB.NET
« on: June 26, 2012, 06:32:11 PM »
I've gotten what should be a simple VB.NET problem regarding Selection Set Filters, but one which I can't figure out.  When using selection set filters in the past, I've only needed to look for specific blocks or lines in specific layers but never both.

I'm trying to make a selection set which searches for an object called WALLSTUD -or- LINES in my WALLS1 & WALLS2 layers.  I don't care what layer WALLSTUD is in, I just need to find them.  I'd like to do this all with one selection set window.

I can do a selection set with one or the other, but I can't do one with both sets of criteria.

This works fine for selecting lines in the WALLS1 and WALLS2 layers.
Code: [Select]
        acPF1.SetValue(New TypedValue(0, "LINE"), 0)
        acPF1.SetValue(New TypedValue(DatabaseServices.DxfCode.Operator, "<or"), 1)
        acPF1.SetValue(New TypedValue(8, "WALLS1"), 2)
        acPF1.SetValue(New TypedValue(8, "WALLS2"), 3)
        acPF1.SetValue(New TypedValue(DatabaseServices.DxfCode.Operator, "or>"), 4)

This works fine for my WALLSTUD objects

Code: [Select]
        acPF1.SetValue(New TypedValue(0, "WALLSTUD"), 0)
I've tried all the different combination of AND & OR operators, but nothing seems to work.  When I try to combine the two, 0 objects get selected in my selection set.

How do I combine these or do I need to create two filters?

Jeff_M

  • King Gator
  • Posts: 4099
  • C3D user & customizer
Re: Problem with Selection Set Filter - VB.NET
« Reply #1 on: June 26, 2012, 06:56:53 PM »
Try this:
Code: [Select]
acPF1.SetValue(New TypedValue(-4, "<OR"), 0)
acPF1.SetValue(New TypedValue(-4, "<AND"), 1)
acPF1.SetValue(New TypedValue(0, "LINE"), 2)
acPF1.SetValue(New TypedValue(8, "WALLS1,WALLS2"), 3)
acPF1.SetValue(New TypedValue(-4, "AND>"), 4)
acPF1.SetValue(New TypedValue(0, "WALLSTUD"), 5)
acPF1.SetValue(New TypedValue(-4, "OR>"), 6)

gablackburn

  • Guest
Re: Problem with Selection Set Filter - VB.NET
« Reply #2 on: June 27, 2012, 10:23:59 AM »
You rock Jeff_M!!  Out of all the combinations I tried, I was close only when I used something similar but swapped the ANDs and ORs.  Also, thanks for the info regarding the operators being "-4" values.

GAB