Why won't this simple script run?

When I run this script across multiple files, it stops when it encounters a drawing that already has the block named "arrw-1"
which it then redefines:
(if (/= (tblsearch "block" "arrw-1") nil) (command ".-insert" "arrw-1=" "y" "0,0" "" "" "" "" "erase" (entlast) "" "qsave") () )
;;;;I have also tried this: (if (/= (tblsearch "block" "arrw-1") nil) (command ".-insert" "arrw-1=" "y" (command) "qsave") () )
...and many other variations. No matter what, if it redefines the block, the script stops and does not process the next drawing.
Aaron
Add pictures here
<% if( /^image/.test(type) ){ %>
<% } %>
<%-name%>
Add image file
Upload
I found my solution. I don't kn ow why it works, but, this did it (where "?" is the name of the block I'm redefining and _Path is the path):
(if (/= (tblsearch "block" "?") nil) (Progn(command ".-insert" "?=c:/_Path"/?.dwg" "y" "1" "0,0" "" ^C) (entdel(entlast)) (command "qsave")) () )
Add pictures here
<% if( /^image/.test(type) ){ %>
<% } %>
<%-name%>
Add image file
Upload

Polytechforum.com is a website by engineers for engineers. It is not affiliated with any of manufacturers or vendors discussed here. All logos and trade names are the property of their respective owners.