Hi everyone,
I ´m tryng to do a app for saveas diferents files.
I used this command
(command "SAVEAS" "LT2004" FILENAME_NEW)
where FILENAME_NEW is the new name.
But when I used this command the result is NIL.
there is any idea abot the fail?
@scottividal wrote:
.... when I used this command the result is NIL. ....
The (command) function always returns nil [read about it in the AutoLisp Functions Reference]. That doesn't mean it didn't work.
Be careful using "/" in directory names in some situations a space in the directory or file name will cause an error. Far safer using "\\". The space is detected as end of name. "C:/acadtemp/my lisps/lisp1.lsp" the blue is dropped.
Hi again,
There arent any problem with \ beacasue I obtain the filepath.
I didn´t know that always print "NIL", thanks.
I write my code, for any review:
(defun c:SaveAs()
(setq FILENAME_OLD (getvar "dwgname"))
(setq FILEPATH (getvar "dwgprefix"))
(setq TEXT1 (vl-string-right-trim "HELLO.dwg" FILENAME_OLD))
(setq TEXT2 "WORLD")
(setq FILENAME_NEW (strcat TEXT1 TEXT2))
(command "_.SAVEAS" "LT2004" FILENAME_NEW)
(setq FILENAME_OLD NIL )
(setq FILEPATH NIL )
(setq TEXT1 NIL )
(setq TEXT2 NIL )
(setq FILENAME_NEW NIL )
)
Can't find what you're looking for? Ask the community or share your knowledge.