Jump to content

Recommended Posts

Posted

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

  • Replies 23
  • Created
  • Last Reply

Top Posters In This Topic

  • Designer

    8

  • Tharwat

    7

  • BlackBox

    3

  • BIGAL

    2

Top Posters In This Topic

Posted Images

Posted

Hi, that did not renamed the ccf2 to ccf3, it added ccf3 before the ccf2.

Posted

I think Bigal indicates to the command *rename* .

 

Why did not that work for you ?

 

How did you make it ?

Posted

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

Posted

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

Posted

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 :|

Posted

Write down the name of your existed layers in a drawing , and the new name for each one .

Posted

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.

Posted

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.

Posted

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 :)

Posted
Write down the name of your existed layers in a drawing , and the new name for each one .

 

^^^ again .

Posted

It takes to long to write all layers names and the new ones in a drawing.

Posted
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 ?

Posted (edited)

Screen shot:

CT_rename.png

 

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. :ouch:

Edited by BlackBox
Posted
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.^^

Posted

... Looks like HOT'Lanta is a lil' slow on the draw today. :lol::P LoL

Posted
... Looks like HOT'Lanta is a lil' slow on the draw today. :lol::P LoL

 

 

It reminds me I need a cup of coffee.

Posted

It was morning and i didn`t field the old name :oops: now it works like a charme hehehe.

Sorry guys. Going to remove that email :)

Posted
So how the routine would search for the name of the required layer to be renamed ?

 

Hint: *wcmatch* :wink:

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.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


×
×
  • Create New...