ExportToAutocad: Stop Prompts
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 Hi Mitch, and welcome to CADTutor.
Firstly, I would recommend that you read the Code Posting Guidlines, so that you know how to format code for future posts.
Now, regarding the code, assuming the variable DWGN2 contains a valid filename, I think:
(if (findfile DWGN2) (command "_.-exporttoautocad" "_F" "2010" "" DWGN2 "_Y") (command "_.-exporttoautocad" "_F" "2010" "" DWGN2))
Note, however, that this doesn't allow for the case in which the filename already exists and is in use. Ok this works, but how to overwrite the file? (use same file name of the file that the lisp is used at)
This should be done using script so one could create new file with suffix or prefix, than close the file, delete original, rename new file to old file name and reopen it...
anybody knows how to script it?
and batch ...?
Oh, and more important of all,
how to prevent loss of page setups and named views when using the exporttoautocad command?!
The loss of above is bloody irritating....
this is what i use to avoid all the dialogs
(command "-exporttoautocad" "_F" "2013" "_B" "N" "_T" "I" "_M" "N" "_P" "1_" "_S" "." "" "")
it produces the file in 2013 format, no xrefs binded, with 1_ prefix in file name.
页:
[1]