HI !
could someone tell me how to delete all entities in the modellspace ?
reagards Jan
Only saying VB.NET does not provide enough details/information for others to help. Which API do you want to use (COM or .NET), what context the actual deleting code you are going to put into (i.e. do you know how to make the code work if a few line of COM or .NET code is provided)? Anyway, here is afew line of code using .NET API
Public Sub DleteleEntitiesInModel(Document dwg)
Using tran As Transaction=dwg.StartTransaction()
ObjectId spaceId=SymbolUtilityServices.GetBlockModelSpaceId(dwg.Database)
Dim space As BlockTableRecord = DirectCast( _
tran.GetObject(spaceId, OpenMode.ForRead), BlockTableRecord)
For Each id As ObjectId in space
Dim ent As Entity=DirectCast(tran.GetObject(id, OpenMode.ForWrite), Entity)
ent.Erase()
Next
tran.Commit();
End Using
End Sub
Assume you know how to incorporate into your application project
Norman Yuan