马上注册,结交更多好友,享用更多功能,让你轻松玩转社区。
您需要 登录 才可以下载或查看,没有账号?立即注册
×
By Virupaksha Aithal
You can use “Editor.SetImpliedSelection” API to clear the pick first (selection with grips) selection set. The code below first gets the list of objects in pick first selection set and clear the selection set later by passing empty ObjectId array to SetImpliedSelection.
- [CommandMethod("ClearPickFirst", CommandFlags.UsePickSet |
- CommandFlags.Redraw | CommandFlags.Modal)]
- static public void ClearPickFirst()
- {
- Document doc = Application.DocumentManager.MdiActiveDocument;
- Editor ed = doc.Editor;
-
- try
- {
- PromptSelectionResult result = ed.SelectImplied();
-
- if (result.Status != PromptStatus.OK)
- return;
-
- SelectionSet ss = result.Value;
- ObjectId[] ids = ss.GetObjectIds();
-
- ed.WriteMessage("Pick first has " +
- ids.Length.ToString() + " entities");
-
- ObjectId[] newIds = new ObjectId[0];
-
- ed.SetImpliedSelection(newIds);
- }
- catch (System.Exception ex)
- {
- ed.WriteMessage(ex.Message);
- }
- }
|