.NET
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Delete entites in Drawing

0 REPLIES 0
Reply
Message 1 of 1
Kamala
154 Views, 0 Replies

Delete entites in Drawing

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
0 REPLIES 0

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk DevCon in Munich May 28-29th


Autodesk Design & Make Report

”Boost