plaer 发表于 2007-4-29 15:59:00

请问如何设置选择过滤,请看这段代码的问题。

Editor ed = Autodesk..ApplicationServices.Application.DocumentManager.MdiActiveDocument.Editor;
   Autodesk.AutoCAD.DatabaseServices.TypedValue[] tv = new TypedValue;
   tv=new TypedValue(0,"POLYLINE");
   Autodesk.AutoCAD.EditorInput.SelectionFilter sf = new SelectionFilter(tv);
&nbspromptSelectionOptions opts =new PromptSelectionOptions();
   opts.AllowDuplicates = true;
   opts.MessageForAdding="请选择一条等高线:";
&nbspromptSelectionResultres = ed.GetSelection(opts,sf);
   if(res.Status!=PromptStatus.OK)
    return;
   Autodesk.AutoCAD.EditorInput.SelectionSet ss = res.Value;
   ObjectId[] oids = ss.GetObjectIds();
   for(int i=0;i
以上代码想实现只选择多段线,但是却选不到多段线。是什么问题呢??

sbydo 发表于 2007-8-26 19:43:00

你的等高线是否 “拟合”过,如果拟合过应该可以。
如果没有拟合过,那么就是lwpolyline:   tv=new TypedValue(0,"LWPOLYLINE");轻多义线
页: [1]
查看完整版本: 请问如何设置选择过滤,请看这段代码的问题。