Display full version of the post: AutoCAD 2015 script error using ScriptPro

emuspe163
05.05.2015, 15:28

I have written a script file for use with AutoCad 2015 with the purposes of running multiple files (about 50) from ScriptPro The file is designed to:Open the fileTurn off pop upsBind all Xref'sPurge the drawing twiceNWCout to Navisworks (2015)Turn popups back onThen close without saving When I run the script file within AutoCad it works perfectly but when run from ScriptPro I get the following error: nwexport_FAILED_TO_SAVE_DOC The error does not freeze ScriptPro. It just gives me a FAILED status and continues on to the next file in line. Dows anyone know what this error is reffering to? A copy of my script is below: -------------------------------------filedia0xrefinsertall_AecbBldSysPurge-purgean-purgernnwcoutfiledia1quity-------------------------------------

Vladimir Michl
05.05.2015, 15:42

Not remembering exactly but doesn't NWCOUT need any filenames or overwrite confirmations?Isn't the Navis file opened? Have you considered using directly DWG files in Navisworks (instead of the exported formats)?

emuspe163
05.05.2015, 16:22

Thanks for the reply! Yes, NWCOUT does propt for a file name but when you turn FILEDIA to (0) there are no pop up menus and it prompts you for a default file name with the dwg extension changed to nwc. Then the following line in the script is left blank to denote an "enter" command confirming that default file name.  No, the Navisworks drawing is not opened. This would explain the problem if it were and the eror woud occur on the second fle when it tried to write but this is not the case. Running the script within AutoCad just simply creates the nwc file in the parent location. I can not simply append the files into Navis from their current location. The script was created to perform several maintence tasks on each file prior to exporting. I frequently have to perform this procedure across hundreds of files at a time. This process takes an eternity to do one at a time and if I were to simply append into Navisworks I would first have to open the file, elevate the file to the proper elevation, purge the file, save the new file as a "clean, elevated version" then append that file into Navis. the repeat this process 250 times.  As I stated in the post, the script runs perfectly within AutoCAD so it's apparently a ScriptPro issue.