ExportToAutocad: Stop Prompts to Overwrite File?!
I'm am attempting to export models from Plant 3D using ExportToAutoCAD. However, I don't want to be prompted as to whether I want to overwrite, I just want it to save these files out, whether the file exists or not.
My lisp skills are sorely lacking but I thought I might try this statement, but my syntax is incorrect:
((if(findfile DWGN2))(command "-EXPORTTOAUTOCAD" "2010" DWGN2 "y")(command "-EXPORTTOAUTOCAD" "2010" DWGN2))
What is the correct way to write this?
There is probably much better way to accomplish this task so any help would be much appreciated!
Thanks,
Mitch
Re: ExportToAutocad: Stop Prompts to Overwrite File?!
You could issue the command, then check if a command is still active. E.g. (untested):
Code:
(command "EXPORTTOAUTOCAD" "2010" DWGN2)
(while (> (getvar 'CmdActive) 0) (command "YES"))
Alternatively you could check if the file already exists, then use vl-file-delete to delete it before exporting.
BTW, your code has some extra parenthesis: e.g.
Code:
((if(findfile DWGN2)) ...
Thus the if statement returns a T and that is then interpreted as a function to be called. The T is not a function and would produce an error.