利用选择集对polyline进行过滤
利用选择集对polyline进行过滤时,为什么选不到。而对比如LINE,CIRCLE均可实现?? <p>这个问题我这个菜鸟也遇到了,高手们帮帮忙解决下: </p><p> Database db = HostApplicationServices.WorkingDatabase;<br/> Editor ed = Application.DocumentManager.MdiActiveDocument.Editor;<br/> Transaction trans = db.TransactionManager.StartTransaction();</p><p> TypedValue[] filList = new TypedValue;<br/> filList = new TypedValue((int)DxfCode.Start, "PolyLine");<br/> SelectionFilter filter = new SelectionFilter(filList);</p><p> PromptSelectionOptions Opts = new PromptSelectionOptions();<br/> PromptSelectionResult res = ed.GetSelection(Opts,filter);</p><p></p> <p>曲线救国,这个法子好像可以:</p><p> Database db = HostApplicationServices.WorkingDatabase;<br/> Editor ed = Application.DocumentManager.MdiActiveDocument.Editor;<br/> Transaction trans = db.TransactionManager.StartTransaction();</p><p> PromptSelectionOptions Opts = new PromptSelectionOptions();<br/> PromptSelectionResult res = ed.GetSelection(Opts);<br/> Polyline plineSelected = new Polyline();</p><p> if (res.Status != PromptStatus.OK)<br/> {<br/> ed.WriteMessage("您所选的不是PLINE线实体!");<br/> trans.Commit();<br/> trans.Dispose();<br/> return;<br/> }</p><p> Autodesk.AutoCAD.EditorInput.SelectionSet SS = res.Value;</p><p> ObjectId plid = SS.GetObjectIds();//获取所选Pline线的ID<br/> Entity ent = (Entity)trans.GetObject(plid, OpenMode.ForRead, false);</p><p> if (ent.GetType() == typeof(Polyline))<br/> {<br/> plineSelected = (Polyline)ent;<br/> }<br/> double dtemp = plineSelected.StartPoint.X;<br/> <br/> trans.Commit();<br/> trans.Dispose();</p> new TypedValue((int)DxfCode.Start, "LWPolyLine"); <p>new TypedValue(0, "LWPolyLine");</p><p>楼上正解</p> <p>那二维多线段呢????</p><p>还有其他的实体呢??</p><p>斑竹知道吗???</p><p>求救啊!!!!!!!!!!!!</p><p>谢谢。</p> <p>知道了</p><p>"polyline"</p><p>但怎么读取二维多线段Polyline2d的顶点???</p><p></p>
页:
[1]