Change all layers to Orange or Combine all layers to one layer
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Good morning all -
Looking for a little help here. I've gotten about 90% of the way there. I am having a hang up with changing all layers to one color, if this is not attainable then possibly I can combine all layers into one layer and change that one layer to the color I want. I was using the Layer Translator previously to combine all layers and then would choose the color I wanted that layer to be but again if I could just type in my command to perform all my functions that would be ideal.
Thank you all for your help, here is my code so far.
(defun c:TCD-PLB ()
(setq doc (vla-get-ActiveDocument (vlax-get-acad-object)))
(setq layers (vla-get-Layers doc))
(setq newLayerName "XREF")
; Create a new layer
(setq newLayer (vla-Add layers newLayerName))
(vla-put-Color newLayer acOrange)
(vla-put-PlotStyleName newLayer "Normal")
; Delete dimensions on the "A-ANNO-DIMS" layer
(vlax-for obj (vla-get-ModelSpace doc)
(if (= (vla-get-Layer obj) "A-ANNO-DIMS")
(vla-erase obj)
)
)
; Delete dimensions on the "S-GRID-IDEN" layer
(vlax-for obj (vla-get-ModelSpace doc)
(if (= (vla-get-Layer obj) "S-GRID-IDEN")
(vla-erase obj)
)
)
; Delete gridlines on the "S-GRID-1" layer
(vlax-for obj (vla-get-ModelSpace doc)
(if (= (vla-get-Layer obj) "S-GRID-1")
(vla-erase obj)
)
)
; Delete gridlines on the "S-GRID-2" layer
(vlax-for obj (vla-get-ModelSpace doc)
(if (= (vla-get-Layer obj) "S-GRID-2")
(vla-erase obj)
)
)
(princ "\nTCD PLB executed successfully.")
)
(princ)