All,
Happy Wednesday! Here is my new issue. I have written the LISP routine below. The idea is that it will get the layers in the current drawing, check them against a list of standard layers and if the layer is a standard layer the routine will set the color, linetype, plot setting and description from the standard. I can get it to run and set colors, but once I add any of the other settings, it stops working. As you can see, I have commented out the settings I can't get to run.
Any help is appreciated.
Code:
(defun c:standard (/ activedocument eachlayer dwglayername checklayer standardlayers standardlayername layercolor)
(setq standardlayers
(list
'("-ANNO-BRNG"
132
"Continuous"
1
"Annotation, Bearings and distance labels"
)
'("G-ANNO-DIMS" 132
"Continuous" 1
"Annotation, Dimensions"
)
'("G-ANNO-KEYN" 122
"Continuous" 1
"Annotation, Keynotes"
)
'("G-ANNO-LABL" 132
"Continuous" 1
"Annotation, Labels"
)
'("G-ANNO-LEGN"
132
"Continuous"
1
"Annotation, Legend, symbol keys"
)
'("G-ANNO-LOGO"
132
"Continuous"
1
"Annotation, Company logo"
)
)
)
(vl-load-com)
(setq activedocument (vla-get-activedocument (vlax-get-Acad-Object)))
(vlax-for eachlayer (vla-get-layers activedocument)
(setq dwglayername (vla-get-name eachlayer))
(foreach checklayer standardlayers
(setq standardlayername (nth 0 checklayer))
(setq layercolor (nth 1 checklayer))
;(setq layerlinetype (nth 2 checklayer))
;(setq layerplotsetting (nth 3 checklayer))
;(setq layerdescription (nth 4 checklayer))
(if (= dwglayername standardlayername)
(vla-put-color eachlayer layercolor)
;(vla-put-linetype eachlayer layerlinetype)
;(vla-put-plottable eachlayer layerplotsetting)
;(vla-put-description eachlayer layerdescription)
nil
)
)
)
)