请版主指导一下我这段代码,将实体前置、后置均无效果,即无反应。
<p> //让光栅自动置前置后无反应<br/> public static void g()<br/> {<br/> BlockTableRecord 块表记录;<br/> DrawOrderTable dot;<br/> ObjectIdCollection oo;</p><p> Document acDoc = Application.DocumentManager.MdiActiveDocument;<br/> Database acCurDb = acDoc.Database;<br/> Editor ed = acDoc.Editor;</p><p> PromptSelectionOptions rp = new PromptSelectionOptions();<br/> rp.MessageForAdding = "请选择光栅";<br/> PromptSelectionResult res = acDoc.Editor.GetSelection(rp);<br/> if (res.Status == PromptStatus.OK)<br/> {<br/> SelectionSet acSSet = res.Value;<br/> using (Transaction acTrans = acCurDb.TransactionManager.StartTransaction())<br/> {<br/> BlockTable 块表 = acTrans.GetObject(acCurDb.BlockTableId, OpenMode.ForRead) as BlockTable;<br/> 块表记录 = acTrans.GetObject(块表["*Model_Space"], OpenMode.ForRead) as BlockTableRecord;<br/> dot = (DrawOrderTable)acTrans.GetObject(块表记录.DrawOrderTableId, OpenMode.ForWrite, false);<br/> oo = Ldyh.LdyhAutoCAD.Tools.CollectBlockEnts(块表记录);<br/> dot.MoveBelow(oo, acSSet.ObjectId);<br/> acTrans.Commit();<br/> }<br/> }<br/> }<br/>用MoveToTop、MoveToBottom、MoveBelow、MoveBelow均无反应,<br/>但手工在AutoCAD中操作是可以的,操作顺序是:选择光栅-右键菜单-绘图次序-后置。这样,其它实体都浮在了光栅表面上,即不再被光栅所覆盖了。<br/></p><p></p> <p>看下VBA的帮助<a href="http://www.mjtd.com/object/acad2004/ex_SortentsTable.htm">http://www.mjtd.com/object/acad2004/ex_SortentsTable.htm</a></p><p>或者你应该下载ObjectArx2010 sdk,里面有函数的用法说明</p><pre class="Element100"><strong>Public</strong><strong>Function</strong>
<strong>MoveToTop</strong>(
<strong>collection</strong>
<strong>As</strong> ObjectIdCollection
) <strong>As</strong> void</pre><pre class="Element100"><p class="Element10">Places all the entities specified in the input object ID array at the ending of the draw order. The entities being moved retain their relative draw order.</p><p class="Element10">这里似乎文档有点问题:)</p></pre>
页:
[1]