Hi
I am trying to write a lisp routine that will Freeze all layers, insert layers, colour layers etc , then ***if they exist*** run other functions
for example, If layer 'comm-grid' exists, I want to rename it to 'Grid'
I knocked up a messy bit of code for some functions but obviously get loads of - layer doesnt exist errors etc.
I guess I need to stick an 'if' statement in somewhere but although I have been given if statements before to use, I have not created one from scratch,
I was going to add the layer first whether it existed or not but then I thought id best ask someone how to do it properly.
Bit I began with..................
;Creates Layers
(DEFUN CL ()
(COMMAND "LAYER" "fr" "*" "")
(COMMAND "LAYER" "tH" "*Grid,Grid$,Grid$Txt,Gros,Gros$,Gros$Txt,*S-CORE-GRID" "")
(COMMAND "LAYER" "n" "Grid,Grid$,Grid$Txt,Gros,Gros$,Gros$Txt" "")
(COMMAND "LAYER" "S" "Grid" "")
(COMMAND "LAYER" "C" "6" "Grid$,Grid$Txt" "C" "1" "Gros$,Gros$Txt" "")
)
can anyone assist a novice?
thanks
edit: added code tags