- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
hi,
im trying to write a lisp that insert blocks fast by name with default settings (scale, angel etc)
if im writing the name of the block ok, everything is fine. (and i have no error)
but if im wrong, the lisp repeat itself like i wanted,
and even im writing ok, insert the block, all good.
after that i get an error
"Can't find file in search path:"
**here is a list of all my search paths**
"error: Function cancelled
Cannot invoke (command) from *error* without prior call to (*push-error-using-command*).
Converting (command) calls to (command-s) is recommended.
Command: *Cancel*"
why i get that?
i thought if the 2nd time i do write the name of the block right, it wouldnt get me that error.
(defun c:IB (/ Bname )
(setq Bname (getstring "enter block name: "))
(if
(null (findfile (strcat Blocks_path Bname ".dwg")))
(progn
(alert (strcat "Can't find " Bname ".dwg in BLOCKS folder"
"\nPlease try again"))
(c:IB)
);progn
);if
(command "_.insert" (strcat Blocks_path Bname ".dwg") pause)
(while (> (getvar "CMDACTIVE") 0)
(command "")
);while
(command ".explode" (entlast))
(princ)
);defun
Bname - is the block name
Blocks_path - is my blocks path folder already set in my accaddoc file
tnx for ure help 😃
Solved! Go to Solution.