static public void test() // This method can have any name { Editor ed = Application.DocumentManager.MdiActiveDocument.Editor; ; TypedValue[] filList = new TypedValue[] { new TypedValue(0,"PolyLine"),new TypedValue((int)DxfCode.LayerName, "地质点") }; SelectionFilter filter = new SelectionFilter(filList); PromptSelectionResult res = ed.GetSelection( filter); if (res.Status != PromptStatus.OK) return; Autodesk.AutoCAD.EditorInput.SelectionSet SS = res.Value; ObjectId[] idArray; idArray = SS.GetObjectIds(); foreach (ObjectId employeeId in idArray) {ed.WriteMessage(employeeId.ToString());
} |