Created
July 5, 2020 06:37
-
-
Save chuongmep/c0e2e2acd5fc47d9fcb9308c3741d3ae to your computer and use it in GitHub Desktop.
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
[CommandMethod("GetSelection")] | |
public static void SelectionTest() | |
{ | |
var ed = Application.DocumentManager.MdiActiveDocument.Editor; | |
var pso = new PromptSelectionOptions(); | |
pso.SingleOnly = true; | |
pso.SinglePickInSpace = true; | |
PromptSelectionResult psr; | |
var ids = new ObjectIdCollection(); | |
while (true) | |
{ | |
psr = ed.GetSelection(pso); | |
if (psr.Status != PromptStatus.OK) | |
break; | |
ids.Add(psr.Value[0].ObjectId); | |
ed.WriteMessage("\n{0} selected objects", ids.Count); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment