Print Page | Close Window

AutoCAD 2015 script error using ScriptPro

Printed From: CAD Forum
Category: EN
Forum Name: AutoCAD
Forum Description: Discussion about AutoCAD and AutoCAD LT, viewers, DWG and DXF formats, Design Review, AutoCAD web, Drive, add-ons
URL: https://www.cadforum.cz/forum_en/forum_posts.asp?TID=11149
Printed Date: 13.Jun.2026 at 07:23


Topic: AutoCAD 2015 script error using ScriptPro
Posted By: emuspe163
Subject: AutoCAD 2015 script error using ScriptPro
Date Posted: 05.May.2015 at 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 file
Turn off pop ups
Bind all Xref's
Purge the drawing twice
NWCout to Navisworks (2015)
Turn popups back on
Then 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:
 
-------------------------------------
filedia
0
xrefinsert
all
_AecbBldSysPurge
-purge
a
n
-purge
r
n
nwcout
filedia
1
quit
y
-------------------------------------


-------------
John Clous
MEP/BIM Coordinator
Gibson Electric



Replies:
Posted By: Vladimir Michl
Date Posted: 05.May.2015 at 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)?


-------------
Vladimir Michl (moderator)
ARKANCE - https://arkance.world" rel="nofollow - https://arkance.world - Autodesk Platinum Partner


Posted By: emuspe163
Date Posted: 05.May.2015 at 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.


-------------
John Clous
MEP/BIM Coordinator
Gibson Electric



Print Page | Close Window