Designer Posted July 25, 2011 Share Posted July 25, 2011 Hi, Is there a lisp that can search the layers name and then replace the name we want like, I have 5 layers that starts with CCF2 and i want to change it to CCF3, is this possible? Cheers Quote Link to comment Share on other sites More sharing options...
BIGAL Posted July 26, 2011 Share Posted July 26, 2011 check out rename ccf2* now ccf3* all done Quote Link to comment Share on other sites More sharing options...
Designer Posted July 26, 2011 Author Share Posted July 26, 2011 Hi, that did not renamed the ccf2 to ccf3, it added ccf3 before the ccf2. Quote Link to comment Share on other sites More sharing options...
Tharwat Posted July 26, 2011 Share Posted July 26, 2011 I think Bigal indicates to the command *rename* . Why did not that work for you ? How did you make it ? Quote Link to comment Share on other sites More sharing options...
Designer Posted July 26, 2011 Author Share Posted July 26, 2011 I used the comand *rename*, then i selected the layers that i wanted to rename and wrote ccf3* I wanted to rename eg_ ccf2_0_LT_house ccf2_1_LT_garden to ccf3_0_LT_house ccf3_1_LT_garden Quote Link to comment Share on other sites More sharing options...
Tharwat Posted July 26, 2011 Share Posted July 26, 2011 Try this buddy. (defun c:test (/ old new) ;; Tharwat 26. 07. 2011 (cond ((not (setq old (getstring T "\n Enter name of Existed Layer :")) ) ) ((not (setq new (getstring T "\n Enter The New name of Layer to rename :") ) ) ) ((not (tblsearch "LAYER" old)) (princ "\n Name of Layer is not existed ") ) ((progn (command "_.-rename" "_Layer" old new) (princ "\n Well done >> ") ) ) ) (princ) ) Tharwat Quote Link to comment Share on other sites More sharing options...
Designer Posted July 26, 2011 Author Share Posted July 26, 2011 This works, but i have to do this layer by layer, is there a way to do this to all layers simultaneous? I have like 120 Layers to change Quote Link to comment Share on other sites More sharing options...
Tharwat Posted July 26, 2011 Share Posted July 26, 2011 Write down the name of your existed layers in a drawing , and the new name for each one . Quote Link to comment Share on other sites More sharing options...
Designer Posted July 26, 2011 Author Share Posted July 26, 2011 This is like changing one by one that`s what i`ve been doing. I wanted to change all at the same time, like the rename comand but it with a replace comand integrated. Quote Link to comment Share on other sites More sharing options...
BIGAL Posted July 26, 2011 Share Posted July 26, 2011 RENAME definately allows wildcard changes as per my first post rename x* to Y* will only change the x to y takes seconds to do manually. let alone write a lisp etc. Have a go at it. Quote Link to comment Share on other sites More sharing options...
Designer Posted July 26, 2011 Author Share Posted July 26, 2011 When i used rename comand it did not replaced the name it added the preffix to the existed layer eg: I have the layer ccf2_0_LT_house and want to put ccf3_0_LT_house, when i used the rename comand it puts ccf3ccf2_0_LT_house I want to do this for 120 layers at the same time, doing it one by one it takes times and its a little boring Quote Link to comment Share on other sites More sharing options...
Tharwat Posted July 26, 2011 Share Posted July 26, 2011 Write down the name of your existed layers in a drawing , and the new name for each one . ^^^ again . Quote Link to comment Share on other sites More sharing options...
Designer Posted July 26, 2011 Author Share Posted July 26, 2011 It takes to long to write all layers names and the new ones in a drawing. Quote Link to comment Share on other sites More sharing options...
Tharwat Posted July 26, 2011 Share Posted July 26, 2011 It takes to long to write all layers names and the new ones in a drawing. So how the routine would search for the name of the required layer to be renamed ? Quote Link to comment Share on other sites More sharing options...
BlackBox Posted July 26, 2011 Share Posted July 26, 2011 (edited) Screen shot: Command line output: Command: ren RENAME 1 Layer renamed Edit: I don't know if you're aware of the risk you're taking by posting your email address in a forum, but you're begging for spammers to attack your inbox, dude. Edited July 26, 2011 by BlackBox Quote Link to comment Share on other sites More sharing options...
DNK Posted July 26, 2011 Share Posted July 26, 2011 I used the comand *rename*, then i selected the layers that i wanted to rename and wrote ccf3*I wanted to rename eg_ ccf2_0_LT_house ccf2_1_LT_garden to ccf3_0_LT_house ccf3_1_LT_garden In the rename dialog box, make sure Layer is highlighted in the Named Objects panel, then, WITHOUT SELECTING THE LAYERS, type in ccf2* in the Old Name:, and ccf3* in the Rename to. ^^Ohhmph, beat by 2 minutes.^^ Quote Link to comment Share on other sites More sharing options...
BlackBox Posted July 26, 2011 Share Posted July 26, 2011 ... Looks like HOT'Lanta is a lil' slow on the draw today. LoL Quote Link to comment Share on other sites More sharing options...
DNK Posted July 26, 2011 Share Posted July 26, 2011 ... Looks like HOT'Lanta is a lil' slow on the draw today. LoL It reminds me I need a cup of coffee. Quote Link to comment Share on other sites More sharing options...
Designer Posted July 26, 2011 Author Share Posted July 26, 2011 It was morning and i didn`t field the old name now it works like a charme hehehe. Sorry guys. Going to remove that email Quote Link to comment Share on other sites More sharing options...
Lee Mac Posted July 26, 2011 Share Posted July 26, 2011 So how the routine would search for the name of the required layer to be renamed ? Hint: *wcmatch* :wink: 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.