Thanks Keith, works out perfectly...except I had the things to do after the tablesearch backwards...
Final Code:
;;***********************************************
;; LeaderUpdate.lsp *
;; Created by Dominic Cesare *
;; 07.29.04 *
;;***********************************************
;;**********************
;;* Start of Routine *
;;**********************
;define function
(defun c:LeaderUpdate (/ oldecho oldsnaps ent)
(setq oldecho (getvar "cmdecho"))
(setq oldsnaps (getvar "osmode"))
(setvar "cmdecho" 0)
(setvar "osmode" 0)
;;******************************
;;Insert "LeaderRC" block*******
;;******************************
;determine if LeaderRC is a current block in the drawing
(if (tblsearch "block" "LeaderRC")
;if LeaderRC is already in the drawing
(prompt "\n***LeaderRC already inserted***")
;if LeaderRC is NOT already in the drawing
(progn
(command "-insert" "LeaderRC" "0,0" "" "" "")
(setq ent (entlast))
(command "erase" ent "")
(prompt "\n***LeaderRC inserted successfully***")
)
)
;;******************************
;;Update current arrows*********
;;******************************
;determine if Arrow2 is a current block in the drawing
(if (tblsearch "block" "Arrow2")
;if Arrow2 is already in the drawing
(progn
(command "-insert" "LeaderRC" "0,0" "" "" "180")
(setq ent (entlast))
(command "explode" ent)
(command "-block" "arrow2" "y" "0,0" "p" "")
(prompt "\n***Old arrow block updated***")
)
;if Arrow2 is NOT already in the drawing
(prompt "\n***No older arrows to update***")
)
;;********************************
;;Resetting changed variables*****
;;********************************
(setvar "cmdecho" oldecho)
(setvar "osmode" oldsnaps)
(princ)
)
;informs user how to run lisp
(prompt "\nType LeaderUpdate to run.....")
(princ)
;;**********************
;;* End of Routine *
;;**********************