Author Topic: Layer State name doesn't show in dialog box  (Read 2435 times)

0 Members and 1 Guest are viewing this topic.

Matt__W

  • Seagull
  • Posts: 12955
  • I like my water diluted.
Layer State name doesn't show in dialog box
« on: November 13, 2008, 11:11:29 AM »
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?

Code: [Select]
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
Autodesk Expert Elite
Revit Subject Matter Expert (SME)
Owner/FAA sUAS Pilot @ http://skyviz.io

Matt__W

  • Seagull
  • Posts: 12955
  • I like my water diluted.
Re: Layer State name doesn't show in dialog box
« Reply #1 on: November 13, 2008, 11:19:15 AM »
Well this is odd.  Instead of using 'acLsAll' I used the code below and now it shows up in the dialog box.  Huh.  :?

Code: [Select]
Public Sub LS()
    Dim objLSM As AcadLayerStateManager
   
    Set objLSM = ThisDrawing.Application.GetInterfaceObject("AutoCAD.AcadLayerStateManager.17")
    objLSM.SetDatabase ThisDrawing.Database
   
    objLSM.Save "Temp_Layer_State2", [color=red]acLsColor + acLsFrozen + acLsLineType + acLsLineWeight + acLsLocked + acLsNewViewport + acLsNone + acLsOn + acLsPlot + acLsPlotStyle[/color]
    Set objLSM = Nothing
End Sub
Autodesk Expert Elite
Revit Subject Matter Expert (SME)
Owner/FAA sUAS Pilot @ http://skyviz.io

Spike Wilbury

  • Guest
Re: Layer State name doesn't show in dialog box
« Reply #2 on: November 13, 2008, 11:33:24 AM »
Matt,

As far as I recall / know  - that's a known bug.

Matt__W

  • Seagull
  • Posts: 12955
  • I like my water diluted.
Re: Layer State name doesn't show in dialog box
« Reply #3 on: November 13, 2008, 11:34:00 AM »
Matt,

As far as I recall / know  - that's a known bug.

Ah... that would explain it!

Thanks!
Autodesk Expert Elite
Revit Subject Matter Expert (SME)
Owner/FAA sUAS Pilot @ http://skyviz.io