The LayerStateManager object provides a set of functions for creating and manipulating saved layer states. Use the following LayerStateManager functions for working with layer states:
Deletes a saved layer state.
Exports the specified saved layer state to a LAS file.
Imports a layer state from the specified LAS file.
Imports a layer state from another database.
Renames a saved layer state.
Restores the specified layer state in the current drawing.
Saves the specified layer state and its properties.
The LayerStateManager object for a database can be accessed by using the LayerManagerState property of a Database object.
Dim acDoc As Document = Application.DocumentManager.MdiActiveDocument Dim acCurDb As Database = acDoc.Database Dim acLyrStMan As LayerStateManager acLyrStMan = acCurDb.LayerStateManager
Document acDoc = Application.DocumentManager.MdiActiveDocument; Database acCurDb = acDoc.Database; LayerStateManager acLyrStMan; acLyrStMan = acCurDb.LayerStateManager;
After you retrieve the LayerStateManager object, you must associate a database with it before you can access the object's methods. Use the SetDatabase method to associate a database with the LayerStateManager.
Dim oLSM As AcadLayerStateManager Set oLSM = ThisDrawing.Application. _ GetInterfaceObject("AutoCAD.AcadLayerStateManager.20") oLSM.SetDatabase ThisDrawing.Database