If/Then Statement for a LISP Command?

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Hello!
Im trying to make a LISP command so that I can change the name of some selected layers. It runs properly if all the layers are present in the DWG, but if a layer in the LISP is missing in the DWG, it cancels the command. Is there a way I can edit the LISP to have a sort of if/then statement so that if the layer is missing from the DWG, then it skips it and continues on to the layers that ARE there?
Heres my LISP, Thankyou:)
(defun c:AtoIFURN ()
(prompt "All layers have begun being renamed")
(command "CMDECHO" "0")(terpri)
(prompt "Setting layers")(princ)
(command "layer" "unlock" "*" "thaw" "*" "on" "*" "")
(command "layer" "r" "A-FURN-FIXD" "I-FURN-FIXD" "" "")
(command "layer" "r" "A-FURN-SEAT" "I-FURN-SEAT" "" "")
(command "layer" "r" "A-FURN" "I-FURN" "" "")
(command "layer" "s" "0" "")
(command "purge" "LA" "" "N" "" "")
(command "CMDECHO" "1")
(prompt "All layers have been renamed... We hope.")
(princ)
);end defun