.NET

Reply
Contributor
18 Posts
0 Kudos
Registered: ‎03-01-2006
Post 1 of 1

Delete entites in Drawing

64 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
Are you interested in helping shape the future of the Autodesk Community? To participate in this brief usability study, please click here. Your time and input is greatly appreciated!