Message 1 of 8
Plot stuff
Not applicable
06-01-2000
04:24 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
This is driving me crazy, On old drawings I open them, run convertpstyles to
change them to Named plot styles, and then try to run the following but it says
Key Not found
If I open the layer dialog, and open the plot style dialog for a layer I have
Style_1 (missing)..... a few others and then Style 1. If I set one layer to
Style 1 and then rerun the script it works fine. What do I need to do to have
it run without manually setting one layers plot style?
Public Sub setLayers()
Dim objLay As AcadLayer
Dim MSspace As Object
Dim ssheet As String
If ThisDrawing.ActiveSpace = acModelSpace Then
Set MSspace = ThisDrawing.ModelSpace
Else
Set MSspace = ThisDrawing.PaperSpace
End If
MSspace.Layout.PlotWithPlotStyles = True
MSspace.Layout.RefreshPlotDeviceInfo
ssheet = "Strobe.stb"
MSspace.Layout.StyleSheet = ssheet
For Each objLay In ThisDrawing.Layers
If objLay.Name = "AM_VIS" Then
objLay.Lineweight = acLnWt025
ElseIf objLay.Name = "AM_HID" Then
objLay.Lineweight = acLnWt000
Else
objLay.Lineweight = acLnWt009
End If
If objLay.Name = "AM_HID" Then
objLay.Linetype = "HIDDEN"
End If
objLay.PlotStyleName = "Style 1"
Next
End Sub
--
Kent Keller
Strobe Data Inc.
www.strobedata.com
It's true. French kissing can reduce plaque above the gum-line.
change them to Named plot styles, and then try to run the following but it says
Key Not found
If I open the layer dialog, and open the plot style dialog for a layer I have
Style_1 (missing)..... a few others and then Style 1. If I set one layer to
Style 1 and then rerun the script it works fine. What do I need to do to have
it run without manually setting one layers plot style?
Public Sub setLayers()
Dim objLay As AcadLayer
Dim MSspace As Object
Dim ssheet As String
If ThisDrawing.ActiveSpace = acModelSpace Then
Set MSspace = ThisDrawing.ModelSpace
Else
Set MSspace = ThisDrawing.PaperSpace
End If
MSspace.Layout.PlotWithPlotStyles = True
MSspace.Layout.RefreshPlotDeviceInfo
ssheet = "Strobe.stb"
MSspace.Layout.StyleSheet = ssheet
For Each objLay In ThisDrawing.Layers
If objLay.Name = "AM_VIS" Then
objLay.Lineweight = acLnWt025
ElseIf objLay.Name = "AM_HID" Then
objLay.Lineweight = acLnWt000
Else
objLay.Lineweight = acLnWt009
End If
If objLay.Name = "AM_HID" Then
objLay.Linetype = "HIDDEN"
End If
objLay.PlotStyleName = "Style 1"
Next
End Sub
--
Kent Keller
Strobe Data Inc.
www.strobedata.com
It's true. French kissing can reduce plaque above the gum-line.