T O P I C R E V I E W |
shaunpeppers |
Posted - October 18 2006 : 5:12:28 PM Hi,
I am trying to use the script "RENAME LAYER" but I want it to do more than one layer at a time. I have a list that I want to look for and change. It works fine till i get to a layers that does not already exist. how can I have it skip that layer and look for the next one on my list? I have attached a shortend version of my my script below.
;Rename a BLOCK. ;CAN ALSO BE USED TO RENAME ;Block/Dimstyle/LAyer/LType/Style/Ucs/VIew/VPort _RENAME _LAYER ;THE NEXT LINE IS THE LAYER NAME TO REPLACE A-TBLK-LIN1 ;THE NEXT LINE IS THE NEW LAYER NAME 57-A-TBLK-LIN1
_RENAME _LAYER A-TBLK-LIN2 59-A-TBLK-LIN2
_RENAME _LAYER A-TBLK-LIN3 60-A-TBLK-LIN5
_RENAME _LAYER A-TBLK-LIN5 60-A-TBLK-LIN5
_RENAME _LAYER A-TBLK-TEXT 14-A-TBLK-TEXT
_RENAME _LAYER A-TBLK-LOGO 14-A-TBLK-LOGO |
3 L A T E S T R E P L I E S (Newest First) |
n/a |
Posted - October 18 2006 : 8:36:41 PM Great !! I'm glad it worked for you. I get so much help from this and other AutoCAD related forums that it feels good to be able to actually provide some help to someone else once in a while. |
shaunpeppers |
Posted - October 18 2006 : 7:52:04 PM sbubendorf,
great thanks it worked perfect. I added all of my layers in the format you had for the lisp file and everything worked perfect.
Thanks, Shaun |
n/a |
Posted - October 18 2006 : 5:50:47 PM Shaun, Try renaming the attached file with a lsp extension rather than zip extension. Backup your drawings. Place the renamelayers.lsp file in your autocad path or the same folder as your drawings. Create a two line script as follows: (load "renamelayers") renamelayers
Run the script. Hopefully it will work based on the layer names in the script you provided. (If I didn't mistype something.) Let me know if it works or not. If it doesn't, it should be something like a typo that I can fix, if you will let me know. (You can open up the file with a text editor, to see what it is doing. Basically, I just used Lisp to search the drawing for the old layer name. If it exists, then it processes the rename command.)
Download Attachment: renamelayers.zip 1.04 KB |