Change selected standard layers from New to Existing

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Hello,
This lisp I am looking for is probably pretty basic, and would be great at a basic level but may get into the weeds with further customization with my company's blocks with attribute text layers etc.
Overall, I am looking to get help creating a lisp with likely an ssget command or option for select all (current space model/paper) or current selection specific, to change standard company layers from New to Existing versions of those layers. An example standard layer we have is M-EQPT-NEW (Mechanical Equipment New) or M-EQPT-EXST (Mechanical Equipment Existing) both with layer colors dictating a bold vs light lineweight in our .ctb file to differentiate new from existing work.
I feel like this is something possibly achievable with LAYERTRANS but maybe it doesn't have the customization that a lisp would have for selection set to more specifically target what you need changed. Another more specific problem is the text fields in said blocks have a text layer M-ANNO-NEW vs M-ANNO-EXST with colors as well. Because of this often the same block has two different definitions, a new vs an existing. But often this is not an issue because the text is not shx text it is ttf text which will not bold or lighten on plots based off the .ctb, more for layer management and visual clarity while in AutoCAD. I have no problem it remaining the same block but just changing the attribute text layer by instance vs globally in said drawing.
The necessity for this is something that comes up often because a 'legacy' AutoCAD job has to be resurrected and new work done in some area but everything else needs to be converted to existing conditions for the new project.
From a basic standpoint I could imagine the programming routine to go as follows:
- Select set (ssget?) or All of current Model/Paper space
- Convert from New to Exst, or Exst to New
- Utilize layertrans from predefined definitions for layers with settings. Some standard layers may not exist in the drawing yet, will this achieve creating them? Conversely, instead of layertrans maybe layers be created based off necessity? All layers are by standard named consistently aside from the ending suffix -EXST or -NEW. Maybe it could just point to a definitions list for those layers colors and from selection create a list of selected -NEW layers and only generate the inverse -EXST layer for each it encounters.
- Set those objects to that layer from list, is there a way to dig into the block (BATTMAN?) to swap the text layers in the attributes as well?
- Close command.
I am kinda lumping a lot in the middle there, specifically step 3, but this could go different ways.
Thanks in advance for any help!
-Warren