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);
}
}