The LayerStateManager object is similar to the AutoCAD Utility object in that it provides a set of functions for manipulating data. These functions are methods for working with saved layer settings. Use the following LayerStateManager methods to work with saved layer settings:
To access the LayerStateManager object, use the GetInterfaceObject method.
Dim oLSM As AcadLayerStateManager
Set oLSM = ThisDrawing.Application. _
GetInterfaceObject("AutoCAD.AcadLayerStateManager.17")
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.
oLSM.SetDatabase ThisDrawing.Database