Rubbersnow Posted January 15, 2014 Share Posted January 15, 2014 Hey Guys, I have the following problem. I'm working on HVAC project and after I have almost finished the whole project the managers company sent me new template layers file ,that I should follow. So now my "17_COOL_MEPA_SUP" layer and all of his futures (including color,line thicknes and so on) need to be changed to "10_C_HVAC_S" with other futures (different color,different thicknes). I know that I can rename group of layers by using script file ,but can I totally replace group of layers with another group? P.S. I have 130 drawings ,so the manual method is not an option. HEEEEELLLLPPPPP!!!! Quote Link to comment Share on other sites More sharing options...
steven-g Posted January 15, 2014 Share Posted January 15, 2014 Do you mean replacing many layers with one ? That would be layermerge Quote Link to comment Share on other sites More sharing options...
Rubbersnow Posted January 15, 2014 Author Share Posted January 15, 2014 no. I mean for example 30 layers to be replaced with 30 other layers Quote Link to comment Share on other sites More sharing options...
steven-g Posted January 15, 2014 Share Posted January 15, 2014 Then I think your only option is a script or LISP, there is no built in command for bulk rename, unless you could use *wildcard* changes for common parts of a name. Quote Link to comment Share on other sites More sharing options...
Rubbersnow Posted January 15, 2014 Author Share Posted January 15, 2014 I was thinking for script ,but I have no idea how to write it. Pretty complicated for my AutoCad level Quote Link to comment Share on other sites More sharing options...
steven-g Posted January 15, 2014 Share Posted January 15, 2014 Do you have use of Excel ? Quote Link to comment Share on other sites More sharing options...
Rubbersnow Posted January 15, 2014 Author Share Posted January 15, 2014 what do you mean? Quote Link to comment Share on other sites More sharing options...
ReMark Posted January 15, 2014 Share Posted January 15, 2014 AutoCAD 2011. Does that version have the Layer Translator command? In the Layer Translator, you specify the layers in the current drawing that you want to translate, and the layers to translate them to. The translation maps the layers in the current drawing to different layer names and layer properties in a specified drawing or standards file, and then converts them using those mappings. Quote Link to comment Share on other sites More sharing options...
steven-g Posted January 15, 2014 Share Posted January 15, 2014 what do you mean? If you have microsoft Excel it's pretty easy to make a script with that, if you have Excel I can post an example EDIT: Just spotted ReMarks answer, that may be easier Quote Link to comment Share on other sites More sharing options...
Rubbersnow Posted January 15, 2014 Author Share Posted January 15, 2014 yes, I just tried it. "-LAYTRANS" . Is it working for my purpose AutoCAD 2011. Does that version have the Layer Translator command? In the Layer Translator, you specify the layers in the current drawing that you want to translate, and the layers to translate them to. The translation maps the layers in the current drawing to different layer names and layer properties in a specified drawing or standards file, and then converts them using those mappings. Quote Link to comment Share on other sites More sharing options...
Rubbersnow Posted January 15, 2014 Author Share Posted January 15, 2014 yes I have excel. It will be great help if you send me example. If you have microsoft Excel it's pretty easy to make a script with that, if you have Excel I can post an example EDIT: Just spotted ReMarks answer, that may be easier Quote Link to comment Share on other sites More sharing options...
steven-g Posted January 15, 2014 Share Posted January 15, 2014 !! Not available in LT !! EDIT thats the command laytrans not available in LT Quote Link to comment Share on other sites More sharing options...
Rubbersnow Posted January 15, 2014 Author Share Posted January 15, 2014 I'm using complete version of AutoCad 2011 yours is LT you mean Quote Link to comment Share on other sites More sharing options...
steven-g Posted January 15, 2014 Share Posted January 15, 2014 in column A the old names in column B put the new names and column F is the script, it just uses a simple formula to make up the script, select all the cells in column F press Ctrl+C for copy and then on the Autocad command line right click and choose paste. The example is only 8 names but shows the idea. LayerChange.xls Quote Link to comment Share on other sites More sharing options...
ReMark Posted January 15, 2014 Share Posted January 15, 2014 After some searching I did find a lisp routine that in my one and only test did work. It renamed all five layers in my drawing. I suppose if you use a script and call the lisp routine it would be possible to batch process all 130 drawings. Quote Link to comment Share on other sites More sharing options...
Rubbersnow Posted January 15, 2014 Author Share Posted January 15, 2014 After some searching I did find a lisp routine that in my one and only test did work. It renamed all five layers in my drawing. I suppose if you use a script and call the lisp routine it would be possible to batch process all 130 drawings. Yes. If I can rename automatically all of my current layers with the same names as the requested layers ,than I can use "LAYTRANS" and everything will happen in no time can you show me an example of the lisp routine Quote Link to comment Share on other sites More sharing options...
ReMark Posted January 15, 2014 Share Posted January 15, 2014 Show it to you? I can do better than that; I can upload a copy. Hold on....I'll be back. The lisp routine, LayerRename.lsp, has been attached below. I assume you know how to load lisp routines right? I suggest you run a test first. Create a new drawing with five layers named Layer1 thru Layer5. Load the routine and run it. Verify it works. LayerRename.lsp Quote Link to comment Share on other sites More sharing options...
rkent Posted January 15, 2014 Share Posted January 15, 2014 AutoCAD had the Standards command built-in and was made for this very scenario. Quote Link to comment Share on other sites More sharing options...
Rubbersnow Posted January 15, 2014 Author Share Posted January 15, 2014 thank you very much ReMark ,it is working perfect. I've just made the dance of happiness and now half of the office thinks that I'm high or something You are saving me hours of work. 10x :notworthy: Quote Link to comment Share on other sites More sharing options...
ReMark Posted January 15, 2014 Share Posted January 15, 2014 You're entirely welcomed Rubbersnow. I'm glad to hear the lisp routine has helped to solve your problem. You might give some thought to rkent's suggestion re: the Standards command. It could come in handy for addressing problems not addressed by the lisp routine. 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.