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

layerstates

0 REPLIES 0
Reply
Message 1 of 1
Human.Man.Name=Jose
146 Views, 0 Replies

layerstates

For some reason this is not working for me. Please Help!


Public Sub DelLayerStates()
Dim oDocument As Autodesk.AutoCAD.ApplicationServices.Document = Autodesk.AutoCAD.ApplicationServices.Application.DocumentManager.MdiActiveDocument
Dim oDocumentLock As Autodesk.AutoCAD.ApplicationServices.DocumentLock = oDocument.LockDocument
Dim oDatabase As Autodesk.AutoCAD.DatabaseServices.Database = Autodesk.AutoCAD.DatabaseServices.HostApplicationServices.WorkingDatabase
Dim oTransactionManager As Autodesk.AutoCAD.DatabaseServices.TransactionManager = oDatabase.TransactionManager
Dim oTransaction As Autodesk.AutoCAD.DatabaseServices.Transaction = oTransactionManager.StartTransaction()
Try
Dim oExtensionDictionary As Autodesk.AutoCAD.DatabaseServices.DBDictionary = oTransaction.GetObject(oDatabase.LayerStateManager.LayerStatesDictionaryId(True), Autodesk.AutoCAD.DatabaseServices.OpenMode.ForRead)
oTransaction.Commit()
For Each i As Autodesk.AutoCAD.DatabaseServices.DBDictionaryEntry In oExtensionDictionary
Autodesk.AutoCAD.ApplicationServices.Application.ShowAlertDialog(i.Key.ToString)
Next

Catch ex As Exception
Autodesk.AutoCAD.ApplicationServices.Application.ShowAlertDialog(ex.Data)
End Try
oTransaction.Dispose()
oDocumentLock.Dispose()
End Sub
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