马上注册,结交更多好友,享用更多功能,让你轻松玩转社区。
您需要 登录 才可以下载或查看,没有账号?立即注册
×
Setting pick first selection set from using AutoCAD.NET By Virupaksha Aithal
You can use “Editor. SetImpliedSelection” API to set the pick first (selection with grips) selection set. The code below is a code for sample command, which prompts for entity selection and places it to pick first selection set. Please note it's necessary to specify command flags for commands, which access pick first selection set.
- [CommandMethod("SelectTest", CommandFlags.UsePickSet |
- CommandFlags.Redraw | CommandFlags.Modal)]
- static public void SelectTest()
- {
- Document doc = Application.DocumentManager.MdiActiveDocument;
- Editor ed = doc.Editor;
- try
- {
- PromptSelectionResult result = ed.GetSelection();
- if (result.Status != PromptStatus.OK)
- return;
- ed.SetImpliedSelection(result.Value.GetObjectIds());
- }
- catch(System.Exception ex)
- {
- ed.WriteMessage(ex.Message);
- }
- }
|