I've got this snippet of code that will create a layer state called "Temp_Layer_State" but it doesn't show up in the Layer States dialog box. It's in the dictionary and I get a 'duplicate key' error if I try to create again so it does exist. Anyone know the trick to getting it to show up in the dialog box?
Public Sub LS()
Dim objLSM As AcadLayerStateManager
Set objLSM = ThisDrawing.Application.GetInterfaceObject("AutoCAD.AcadLayerStateManager.17")
objLSM.SetDatabase ThisDrawing.Database
objLSM.Save "Temp_Layer_State", acLsAll
Set objLSM = Nothing
End Sub