Hi, all.
All layer on or off is working well.
But all layer freeze or thaw is not working, no change made.
To happen this, how should I repair my code?
Some help?
Application.DocumentManager.MdiActiveDocument.LockDocument()
Dim db As Database = Application.DocumentManager.MdiActiveDocument.Database
Dim tm As Autodesk.AutoCAD.DatabaseServices.TransactionManager = db.TransactionManager
Dim tr As Transaction = tm.StartTransaction()
Try
Dim lt As LayerTable = CType(tm.GetObject(db.LayerTableId, OpenMode.ForRead), LayerTable)
lt.UpgradeOpen()
For Each objId As ObjectId In lt
Dim ireum As String = CType(tm.GetObject(objId, OpenMode.ForRead), LayerTableRecord).Name
Dim lyr As LayerTableRecord = CType(tm.GetObject(objId, OpenMode.ForWrite), LayerTableRecord)
lyr.IsFrozen = True
If ireum = "0" Then
lyr.IsFrozen = False
End If
ALF.Update()
Next
tr.Commit()
Application.DocumentManager.MdiActiveDocument.Editor.Regen()
Catch ex As Exception
tr.Abort()
Finally
tr.Dispose()
End Try