选择失败,看看错在哪,急, [CommandMethod("Test")] public void Test() { Editor ed = AcadApp.DocumentManager.MdiActiveDocument.Editor; try { TypedValue[] filList = new TypedValue[2]; filList[0] = new TypedValue((int)DxfCode.ExtendedDataRegAppName, "MyApp"); filList[1] = new TypedValue((int)DxfCode.ExtendedDataAsciiString, "This is some xdata string"); SelectionFilter filter = new SelectionFilter(filList); PromptSelectionResult res = ed.SelectAll(filter); if (res.Status == PromptStatus.OK) { ed.WriteMessage("选择成功!\n"); } else { ed.WriteMessage("选择失败!\n"); } } catch (System.Exception ex) { ed.WriteMessage(ex.Message); } } |