Why won't this simple script run?

May 23, 2007 1 Replies

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


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")) () )

Join the Discussion

Have something to add? Share your thoughts — no account required.

Didn't find your answer?

Ask the community — no account required