.NET

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

Delete entites in Drawing

56 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

You are not logged in.

Log into access your profile, ask and answer questions, share ideas and more. Haven't signed up yet? Register

Announcements
Are you familiar with the Autodesk Expert Elites? The Expert Elite program is made up of customers that help other customers by sharing knowledge and exemplifying an engaging style of collaboration. To learn more, please visit our Expert Elite website.

Need installation help?

Start with some of our most frequented solutions to get help installing your software.

Ask the Community