请问如何设置选择过滤,请看这段代码的问题。
<p> Editor ed = Autodesk.AutoCAD.ApplicationServices.Application.DocumentManager.MdiActiveDocument.Editor;<br/> Autodesk.AutoCAD.DatabaseServices.TypedValue[] tv = new TypedValue;<br/> tv=new TypedValue(0,"POLYLINE");<br/> Autodesk.AutoCAD.EditorInput.SelectionFilter sf = new SelectionFilter(tv);<br/> PromptSelectionOptions opts =new PromptSelectionOptions();<br/> opts.AllowDuplicates = true;<br/> opts.MessageForAdding="请选择一条等高线:";<br/> PromptSelectionResult res = ed.GetSelection(opts,sf);<br/> if(res.Status!=PromptStatus.OK)<br/> return;<br/> Autodesk.AutoCAD.EditorInput.SelectionSet ss = res.Value;<br/> ObjectId[] oids = ss.GetObjectIds();<br/> for(int i=0;i<oids.Length;i++)<br/> {<br/> ed.WriteMessage("\n"+oids.ToString());<br/> }</p><p>以上代码想实现只选择多段线,但是却选不到多段线。是什么问题呢??</p> <p>你的等高线是否 “拟合”过,如果拟合过应该可以。</p><p>如果没有拟合过,那么就是lwpolyline: tv=new TypedValue(0,"LWPOLYLINE");轻多义线</p>
页:
[1]