a LISP for rename layers and change their colour

a LISP for rename layers and change their colour

Anonymous
Not applicable
1,162 Views
3 Replies
Message 1 of 4

a LISP for rename layers and change their colour

Anonymous
Not applicable

Hi everybody,

I need to create a lisp to rename layers, colours and linetype without creating a new command (no defun). For now i reached this stage  and it works:

 

(setq old_name "OLD" new_name "NEW")
(command "-rename" "layer" old_name new_name)

 

 

I need help to write a script to change their colours and linetypes by layer. It needs to be a single lisp file.

Somebody has experience with that?

Thank you

0 Likes
1,163 Views
3 Replies
Replies (3)
Message 2 of 4

ВeekeeCZ
Consultant
Consultant

You should test the existence of the layer.

Are the variables necessary?

 

(if (tblsearch "LAYER" "MyOldLayer") (command "_.-RENAME" "_LAyer" "MyOldLayer" "NewName"))
(if (tblsearch "LAYER" "MyAnyLayer") (command "_.-LAYER" "_Color" 2 "MyAnyLayer" ""))

 

0 Likes
Message 3 of 4

Anonymous
Not applicable

It works!!!Thank you BeekeeCZ for your help!!

0 Likes
Message 4 of 4

stevor
Collaborator
Collaborator

Do the linetype and color changes apply to all layer renames?

IE, does every rename include the color and linetype changes?

S
0 Likes