AutoCAD.net(二):筛选

1.过滤块
            PromptSelectionOptions pOptions = new PromptSelectionOptions();
            TypedValue[] filList 
=    new TypedValue((int)DxfCode.Start, "INSERT") };
            SelectionFilter filter 
= new SelectionFilter(filList);
            PromptSelectionResult res 
= ed.GetSelection(pOptions, filter);//***
            if (res.Status != PromptStatus.OK) return;
            Autodesk.AutoCAD.EditorInput.SelectionSet SS 
= res.Value;
            ObjectId[] idArray 
= SS.GetObjectIds();

2.过滤多线
            TypedValue[] filList =    new TypedValue((int)DxfCode.Start, "LWPolyLine") };
            SelectionFilter filter 
= new SelectionFilter(filList);
            PromptSelectionResult res 
= ed.SelectAll(filter);//***
                       if (res.Status != PromptStatus.OK) return;
            Autodesk.AutoCAD.EditorInput.SelectionSet SS 
= res.Value;
            ObjectId[] idArray 
= SS.GetObjectIds();
posted @ 2008-01-14 13:48  无锋不起浪  阅读(1513)  评论(1编辑  收藏