I'm trying to write some code that will
1) set the current plot style table to "BCR Plot Style.stb"
2) change all layer properties to plot style name "Grayscale"
Code:
(defun c:grayscale ()
(vl-load-com)
(vla-put-StyleSheet
(vla-get-ActiveLayout
(vla-get-ActiveDocument (vlax-get-acad-object))
)
"BCR Plot Style.stb"
)
(setq layers (vla-get-layers
(vla-get-ActiveDocument (vlax-get-acad-object))
)
)
(vlax-for l layers
(progn
(vla-put-plotstylename l "Grayscale")
)
)
)
)
This routine works after I go into the layer properties manager, highlight all layers, change the plot style to "Grayscale" and then back to "Normal".
It's like it hasn't recognized "Grayscale" as a valid option until it has been manually set.
Is there some way I can make AutoCAD "recognize" Grayscale as a valid option from the beginning?
I feel like this would be a tblsearch or something similar, but would appreciate any suggestions.