JamesBorubar Posted April 27, 2017 Share Posted April 27, 2017 Hi, I can rename layer "new" to "very new". but I cannot rename layer from "very new" to "new". I tried to write a script. But it doesn't work Quote Link to comment Share on other sites More sharing options...
Dadgad Posted April 28, 2017 Share Posted April 28, 2017 (edited) You could do this with LAYTRANS. Or perhaps you can create a new layer, based on "very new", so that it has all the same properties as "very new", then use LAYMRG to merge those two layers onto your newly created "NEW" layer. Did you do a purge of the dwg before trying this, might the layer name NEW exist in the drawing history, so that it is the reason you can't do it? I just opened a new drawing on 2013 Vanilla, created a new layer based on the 0 layer, which I called Very New. I then renamed it to New, with no problems. After which I renamed it again, back to Very New (without having purged), and it worked fine. Sounds like the problem is in your script, not the software. Edited April 28, 2017 by Dadgad Quote Link to comment Share on other sites More sharing options...
JamesBorubar Posted April 28, 2017 Author Share Posted April 28, 2017 You could do this with LAYTRANS.Or perhaps you can create a new layer, based on "very new", so that it has all the same properties as "very new", then use LAYMRG to merge those two layers onto your newly created "NEW" layer. Did you do a purge of the dwg before trying this, might the layer name NEW exist in the drawing history, so that it is the reason you can't do it? I just opened a new drawing on 2013 Vanilla, created a new layer based on the 0 layer, which I called Very New. I then renamed it to New, with no problems. After which I renamed it again, back to Very New (without having purged), and it worked fined. Sounds like the problem is in your script, not the software. Problem is with old name of layer named with two separately words like "Dimension (ISO)", when I use command -rename. I cannot use within script command LAYTRANS. With one drawing it is no problem, but I've got hundred of drawings ... Quote Link to comment Share on other sites More sharing options...
Dadgad Posted April 28, 2017 Share Posted April 28, 2017 How many different layer name changes would you guess you might have? Just a handful, or too numerous to speculate? If it is just a small number, perhaps you could create a Drawing Standards drawing to associate with them. Or just use LAYTRANS, but not in a script? Lee Mac has one that might help you, not sure, I have never used it. http://www.lee-mac.com/pslay.html or possibly http://www.lee-mac.com/scriptwriter.html Thanks Lee! Quote Link to comment Share on other sites More sharing options...
JamesBorubar Posted April 28, 2017 Author Share Posted April 28, 2017 Thanks Dadgad, I've already tried this lisp. It can remove (add) suffix and prefix, but cannot remove "(ISO)" from layer name "Dimension (ISO)". Layers in my drawings are not too many. But drawings are many. Quote Link to comment Share on other sites More sharing options...
maratovich Posted April 28, 2017 Share Posted April 28, 2017 Perhaps a new layer name already exists. It is impossible to have two identical names. Attach an example. Quote Link to comment Share on other sites More sharing options...
steven-g Posted April 28, 2017 Share Posted April 28, 2017 Are you using "quote marks" in your script, because the command works fine from the command line without quotes, but in both macros and scripts will only work when quotes are used, otherwise it translate the spaces into the same as using the enter key Quote Link to comment Share on other sites More sharing options...
JamesBorubar Posted April 28, 2017 Author Share Posted April 28, 2017 (edited) Are you using "quote marks" in your script, because the command works fine from the command line without quotes, but in both macros and scripts will only work when quotes are used, otherwise it translate the spaces into the same as using the enter key Yes, I used "quote marks" but they disappered when saved script with "Script Writer V1.2" by Lee Mac. Why? I don't know. It was reason why I couldn't run my script. Now it works correct. Thanks Edited April 28, 2017 by JamesBorubar Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.