Code Red > .NET

Logical Filter grouping

(1/1)

Draftek:
I'm trying to build a selection set of text and mtext objects in c#

This works in vb:

--- Code: ---   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)

--- End code ---

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: ---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);

--- End code ---

Any clues?

MP:

--- Code: ---filterlist = new TypedValue[1];
filterlist[0] = new TypedValue(0, "TEXT,MTEXT");
filter = new SelectionFilter(filterlist);
selRes = ed.SelectAll(filter);
--- End code ---

Does this woik?

Draftek:
To my surprise, it does...

oooOOOooo!

Your magic....

Navigation

[0] Message Index

Go to full version