Author Topic: Logical Filter grouping  (Read 6827 times)

0 Members and 1 Guest are viewing this topic.

Draftek

  • Guest
Logical Filter grouping
« on: October 11, 2005, 02:55:02 PM »
I'm trying to build a selection set of text and mtext objects in c#

This works in vb:
Code: [Select]
   Dim sstext As AcadSelectionSet
   Dim FilterType(3) As Integer
   Dim FilterData(3) As Variant
   Set sstext = ThisDrawing.SelectionSets.Add("MySS")
   FilterType(0) = -4
   FilterData(0) = "<or"
   FilterType(1) = 0
   FilterData(1) = "TEXT"
   FilterType(2) = 0
   FilterData(2) = "MTEXT"
   FilterType(3) = -4
   FilterData(3) = "or>"
   Call sstext.Select(acSelectionSetAll, FilterType, FilterData)

I get an exception - "Input String was not in a correct format" when I try to apply the filter on the last line here:

Code: [Select]
filterlist = new TypedValue[4];
filterlist[0] = new TypedValue(-4, "<or");
filterlist[1] = new TypedValue(0, "TEXT");
filterlist[2] = new TypedValue(0, "MTEXT");
filterlist[3] = new TypedValue(-4, "or>");
filter = new SelectionFilter(filterlist);
selRes = ed.SelectAll(filter);

Any clues?

MP

  • Seagull
  • Posts: 17750
  • Have thousands of dwgs to process? Contact me.
Re: Logical Filter grouping
« Reply #1 on: October 11, 2005, 03:02:50 PM »
Code: [Select]
filterlist = new TypedValue[1];
filterlist[0] = new TypedValue(0, "TEXT,MTEXT");
filter = new SelectionFilter(filterlist);
selRes = ed.SelectAll(filter);

Does this woik?
Engineering Technologist • CAD Automation Practitioner
Automation ▸ Design ▸ Drafting ▸ Document Control ▸ Client
cadanalyst@gmail.comhttp://cadanalyst.slack.comhttp://linkedin.com/in/cadanalyst

Draftek

  • Guest
Re: Logical Filter grouping
« Reply #2 on: October 11, 2005, 03:18:27 PM »
To my surprise, it does...

oooOOOooo!

Your magic....