-
Notifications
You must be signed in to change notification settings - Fork 18
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
7 changed files
with
66 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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"); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters