加入一个实体,然后把删除,如何让它一加入就显示呢?
在有些操作中需要在图像中加入一些文字,提示用户,提示完在删除,如何实现呢,Dim acDoc As Document = Application.DocumentManager.MdiActiveDocument
Dim acCurDb As Database = acDoc.Database
Dim objId As ObjectId
'' Start a transaction
Using acTrans As Transaction = acCurDb.TransactionManager.StartTransaction()
'' Open the Block table for read
Dim acBlkTbl As BlockTable
acBlkTbl = acTrans.GetObject(acCurDb.BlockTableId, OpenMode.ForRead)
'' Open the Block table record Model space for write
Dim acBlkTblRec As BlockTableRecord
acBlkTblRec = acTrans.GetObject(acBlkTbl(BlockTableRecord.ModelSpace), _
OpenMode.ForWrite)
Dim acText As DBText = New DBText()
acText.SetDatabaseDefaults()
acText.Position = New Point3d(0, 0, 0)
acText.Height = 100
acText.TextString = "Hello!"
acBlkTblRec.AppendEntity(acText)
acTrans.AddNewlyCreatedDBObject(acText, True)
'' Add the new object to the block table record and the transaction
acText.Highlight()
'' Update the display and display an alert message
acDoc.Editor.Regen()
''在删除前显示
acText.Erase(True)
'' Save the new object to the database
Application.ShowAlertDialog("Erase the newly added text.")
acTrans.Commit()
End Using
好像只能第一次运行时能看到文字,在运行就看不见了 奇怪了
<p>试下这个类</p>
<div class="Element5">TransientManager Class</div>
加入一个实体,然后把删除,如何让它一加入就显示呢?
<p>这个 好像是2009新加的 如果2008想用 怎么办呢</p>加入一个实体,然后把删除,如何让它一加入就显示呢?
<font face="Verdana">http://www.theswamp.org/index.php?topic=30771.0</font> <p>2008确实没有这个类</p><p>好像记得以前用Document.GraphicsManager 做过类似的东西</p>
<p>不过很慢而且总是崩溃就没搞下去了</p>
页:
[1]