
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
AutoCAD 2012
C#
Windows 7
I need a selection filter to find text objects within a rectangular area using dxf operators (do not want to use Editor.SelectWindow).
Whats wrong with the following code attempt?
It causes Fatal Error!
Thx.. Kevn..
TypedValue[] tv2 = new TypedValue[15];
tv2.SetValue(new TypedValue((int)DxfCode.Start, "TEXT"), 0);
tv2.SetValue(new TypedValue((int)DxfCode.Operator, "<and"), 1);
tv2.SetValue(new TypedValue((int)DxfCode.Operator, "<and"), 2);
tv2.SetValue(new TypedValue((int)DxfCode.Operator, ">"), 3);
tv2.SetValue(new TypedValue((int)DxfCode.XCoordinate,
Match1[0].GeometricExtents.MinPoint.X - 20), 4);
tv2.SetValue(new TypedValue((int)DxfCode.Operator, "<"), 5);
tv2.SetValue(new TypedValue((int)DxfCode.XCoordinate,
Match1[0].GeometricExtents.MaxPoint.X + 20), 6);
tv2.SetValue(new TypedValue((int)DxfCode.Operator, "and>"), 7);
tv2.SetValue(new TypedValue((int)DxfCode.Operator, "<and"), 8);
tv2.SetValue(new TypedValue((int)DxfCode.Operator, ">"), 9);
tv2.SetValue(new TypedValue((int)DxfCode.YCoordinate,
Match1[0].GeometricExtents.MinPoint.Y + 109), 10);
tv2.SetValue(new TypedValue((int)DxfCode.Operator, "<"), 11);
tv2.SetValue(new TypedValue((int)DxfCode.YCoordinate,
Match1[0].GeometricExtents.MaxPoint.Y + 131), 12);
tv2.SetValue(new TypedValue((int)DxfCode.Operator, "and>"), 13);
tv2.SetValue(new TypedValue((int)DxfCode.Operator, "and>"), 14);
SelectionFilter sf2 = new SelectionFilter(tv2);
PromptSelectionResult psr2 = AcadDoc1.Editor.SelectAll(sf2);
Solved! Go to Solution.