Skip to content

Commit

Permalink
add example mutiple character
Browse files Browse the repository at this point in the history
  • Loading branch information
chuongmep committed May 22, 2022
1 parent 9c09059 commit cf8352d
Show file tree
Hide file tree
Showing 7 changed files with 66 additions and 6 deletions.
60 changes: 60 additions & 0 deletions Test/Selection/FilterRelate.cs
Original file line number Diff line number Diff line change
@@ -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");
}
}
}
2 changes: 1 addition & 1 deletion Test/Selection/MergeSelection.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
using Autodesk.AutoCAD.EditorInput;
using Autodesk.AutoCAD.Runtime;

namespace Test;
namespace Test.Selection;

public class MergeSelection
{
Expand Down
2 changes: 1 addition & 1 deletion Test/Selection/MultiFilterRule.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
using Autodesk.AutoCAD.EditorInput;
using Autodesk.AutoCAD.Runtime;

namespace Test;
namespace Test.Selection;

public class MultiFilterRule
{
Expand Down
2 changes: 1 addition & 1 deletion Test/Selection/PickSelection.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
using Autodesk.AutoCAD.EditorInput;
using Autodesk.AutoCAD.Runtime;

namespace Test;
namespace Test.Selection;

public class PickSelection
{
Expand Down
2 changes: 1 addition & 1 deletion Test/Selection/SelectCross.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
using Autodesk.AutoCAD.Geometry;
using Autodesk.AutoCAD.Runtime;

namespace Test;
namespace Test.Selection;

public class SelectCross
{
Expand Down
2 changes: 1 addition & 1 deletion Test/Selection/SelectionFilters.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
using Autodesk.AutoCAD.EditorInput;
using Autodesk.AutoCAD.Runtime;

namespace Test;
namespace Test.Selection;

public class SelectionFilters
{
Expand Down
2 changes: 1 addition & 1 deletion Test/Selection/SelectionOnScreen.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
using Autodesk.AutoCAD.EditorInput;
using Autodesk.AutoCAD.Runtime;

namespace Test;
namespace Test.Selection;

public class SelectionOnScreen
{
Expand Down

0 comments on commit cf8352d

Please sign in to comment.