Im using this code but it does not work, please help
Code:
Sub ToggleLayers()
Dim i As Integer
Dim blnlayerstate As Boolean
Dim objLayer As AcadLayer
On Error Resume Next
ThisDrawing.ActiveLayout.StyleSheet = "named.stb"
If blnlayerstate = False Then
i = 0
For Each objLayer In ThisDrawing.Layers
objLayer.PlotStyleName = "style1"
Next
End If
End Sub
prior to this code run this and this seems to work fine
Private Function ConvertToStb()
Const sRet As String = """"
Dim sCmd As String
Dim sPstyle As String
sPstyle = ThisDrawing.GetVariable("PSTYLEMODE")
If sPstyle = "1" Then
sCmd = "(command " & sRet & "convertpstyles" & sRet & " " & ")" & vbCr & "Convertstyle" & vbCr
ThisDrawing.SendCommand sCmd
End If
End Function
Best regard
Jesper