diff --git a/Test/Selection/FilterRelate.cs b/Test/Selection/FilterRelate.cs new file mode 100644 index 0000000..7d3564e --- /dev/null +++ b/Test/Selection/FilterRelate.cs @@ -0,0 +1,60 @@ +using Autodesk.AutoCAD.ApplicationServices.Core; +using Autodesk.AutoCAD.DatabaseServices; +using Autodesk.AutoCAD.EditorInput; +using Autodesk.AutoCAD.Runtime; + +namespace Test.Selection; + +public class FilterRelate +{ + [CommandMethod("FilterRelational")] + public void FilterRelational() + + { + // Get the current document editor + + Editor acDocEd = Application.DocumentManager.MdiActiveDocument.Editor; + + + // Create a TypedValue array to define the filter criteria + + TypedValue[] acTypValAr = new TypedValue[3]; + + acTypValAr.SetValue(new TypedValue((int) DxfCode.Start, "CIRCLE"), 0); + + acTypValAr.SetValue(new TypedValue((int) DxfCode.Operator, ">="), 15); + + acTypValAr.SetValue(new TypedValue(40, 5), 2); + + + // Assign the filter criteria to a SelectionFilter object + + SelectionFilter acSelFtr = new SelectionFilter(acTypValAr); + + + // Request for objects to be selected in the drawing area + + PromptSelectionResult acSSPrompt; + + acSSPrompt = acDocEd.GetSelection(acSelFtr); + + + // If the prompt status is OK, objects were selected + + if (acSSPrompt.Status == PromptStatus.OK) + + { + SelectionSet acSSet = acSSPrompt.Value; + + + Application.ShowAlertDialog("Number of objects selected: " + + acSSet.Count.ToString()); + } + + else + + { + Application.ShowAlertDialog("Number of objects selected: 0"); + } + } +} \ No newline at end of file diff --git a/Test/Selection/MergeSelection.cs b/Test/Selection/MergeSelection.cs index 40ff049..63eaaa1 100644 --- a/Test/Selection/MergeSelection.cs +++ b/Test/Selection/MergeSelection.cs @@ -3,7 +3,7 @@ using Autodesk.AutoCAD.EditorInput; using Autodesk.AutoCAD.Runtime; -namespace Test; +namespace Test.Selection; public class MergeSelection { diff --git a/Test/Selection/MultiFilterRule.cs b/Test/Selection/MultiFilterRule.cs index c4a9c1a..1d441a4 100644 --- a/Test/Selection/MultiFilterRule.cs +++ b/Test/Selection/MultiFilterRule.cs @@ -3,7 +3,7 @@ using Autodesk.AutoCAD.EditorInput; using Autodesk.AutoCAD.Runtime; -namespace Test; +namespace Test.Selection; public class MultiFilterRule { diff --git a/Test/Selection/PickSelection.cs b/Test/Selection/PickSelection.cs index e032112..6b5ccfe 100644 --- a/Test/Selection/PickSelection.cs +++ b/Test/Selection/PickSelection.cs @@ -3,7 +3,7 @@ using Autodesk.AutoCAD.EditorInput; using Autodesk.AutoCAD.Runtime; -namespace Test; +namespace Test.Selection; public class PickSelection { diff --git a/Test/Selection/SelectCross.cs b/Test/Selection/SelectCross.cs index e35470d..101c0cc 100644 --- a/Test/Selection/SelectCross.cs +++ b/Test/Selection/SelectCross.cs @@ -3,7 +3,7 @@ using Autodesk.AutoCAD.Geometry; using Autodesk.AutoCAD.Runtime; -namespace Test; +namespace Test.Selection; public class SelectCross { diff --git a/Test/Selection/SelectionFilters.cs b/Test/Selection/SelectionFilters.cs index 19f9ec0..047c9fd 100644 --- a/Test/Selection/SelectionFilters.cs +++ b/Test/Selection/SelectionFilters.cs @@ -3,7 +3,7 @@ using Autodesk.AutoCAD.EditorInput; using Autodesk.AutoCAD.Runtime; -namespace Test; +namespace Test.Selection; public class SelectionFilters { diff --git a/Test/Selection/SelectionOnScreen.cs b/Test/Selection/SelectionOnScreen.cs index 7b32a28..028d0d9 100644 --- a/Test/Selection/SelectionOnScreen.cs +++ b/Test/Selection/SelectionOnScreen.cs @@ -4,7 +4,7 @@ using Autodesk.AutoCAD.EditorInput; using Autodesk.AutoCAD.Runtime; -namespace Test; +namespace Test.Selection; public class SelectionOnScreen {