.NET

Reply
Contributor
Kamala
Posts: 18
Registered: ‎03-01-2006
Message 1 of 1 (61 Views)

Delete entites in Drawing

61 Views, 0 Replies
07-13-2006 10:38 PM
Hi all,

I'm trying to delete all the entites in the drawing.The following code actually takes a set of drawings opens all the drawings one by one and deletes the entites in each drawing.
The deletion of entities happens for single sheet,but dows not function for a set of drawing files.
Kindly suggest some solution

Try
For Each lCTempObjArr In larrMasterBOMlist
larrlistname = lCTempObjArr
lCActiveDoc = Application.DocumentManager.Open(larrlistname, True)
lCActiveDB = lCActiveDoc.Database
lCActiveTransMan = lCActiveDB.TransactionManager
lCActiveTrans = lCActiveTransMan.StartTransaction
lCLock = lCActiveDoc.LockDocument(DocumentLockMode.ProtectedAutoWrite, Nothing, Nothing, True)
lCActiveBlockTable = lCActiveTrans.GetObject(lCActiveDB.BlockTableId, OpenMode.ForWrite)
Dim btr As BlockTableRecord = CType(lCActiveTrans.GetObject(lCActiveBlockTable(btr.ModelSpace), OpenMode.ForWrite), BlockTableRecord)
For Each lCObjectId In btr
Dim Ent As Entity = CType(lCActiveTrans.GetObject(lCObjectId, OpenMode.ForWrite), Entity)
If TypeOf Ent Is BlockReference Then
Else
Ent.Erase()
End If
Next
Next

lCActiveTrans.Commit()
lCLock.Dispose()

Thanks in advance
Kamala
Post to the Community

Have questions about Autodesk products? Ask the community.

New Post
Announcements
Do you have 60 seconds to spare? The Autodesk Community Team is revamping our site ranking system and we want your feedback! Please click here to launch the 5 question survey. As always your input is greatly appreciated.