Batch save utility gives me a stack overflow error "save failed(errorno:-1073741571)"

Batch save utility gives me a stack overflow error "save failed(errorno:-1073741571)"

Ann-Marie_Valois
Participant Participant
678 Views
2 Replies
Message 1 of 3

Batch save utility gives me a stack overflow error "save failed(errorno:-1073741571)"

Ann-Marie_Valois
Participant
Participant

Hi,

 

I'm a heavy batch save utility user. I've written a couple of scripts that I run very often with the tool and it works fantastically until I tried this script :

(command "_.SETBYLAYER" "all" "" "_Y" "_Y")
(Command "_.qsave")
_QUIT
Y

 

In Civil 3D this works even on drawings with 20 000+ objects. When I try to do this with the batch save utility, I get the stack overflow error : "save failed(errorno:-1073741571)".

 

I'm CAD Manager on a major project, I have about 500+ files to process almost weekly.

 

I'm thinking going Dynamo on this one and running it in the batch save utility. Any thoughts, suggestions, comments?

0 Likes
679 Views
2 Replies
Replies (2)
Message 2 of 3

brucewilkerson
Community Visitor
Community Visitor

The stack overflow error you're encountering with the batch save utility in Civil 3D can be tricky, especially when dealing with a large number of files and objects. Here are some suggestions and alternatives that might help you tackle this issue:

1. Memory Management:
Increase System Resources: Ensure that your system has sufficient RAM and virtual memory allocated. Sometimes, increasing system resources can help alleviate stack overflow issues, especially with large drawings.
Run in Smaller Batches: If possible, split the 500+ files into smaller batches and run your script on these subsets to reduce the load on the batch save utility.
2. Script Optimization:
Simplify Commands: The _SETBYLAYER command can be resource-intensive when applied to all objects in a large drawing. Consider breaking down the command to process objects in smaller chunks, if possible.
Try Another Approach: Instead of using the SETBYLAYER command on all objects in one go, try iterating over object types or layers separately. This could help reduce the risk of a stack overflow.
3. Use Dynamo or Custom Code:
Dynamo: Dynamo for Civil 3D could be a viable alternative if you have experience with it. It allows you to automate tasks with more control and flexibility. You can create a script in Dynamo to loop through all files and execute the necessary commands in a more controlled manner.
AutoLISP or .NET API: If you're comfortable with coding, AutoLISP or the Civil 3D .NET API can offer more robust handling of large-scale batch processes. These programming options provide better error handling and memory management, which could prevent stack overflow errors.
4. Custom Batch Processing Tools:
Custom Batch Scripts: If Dynamo or coding isn't an option, consider developing a custom batch processing tool that works alongside Civil 3D. You can script the process to open each file, execute the commands, save, and close the file with more granular control over memory usage.
5. Civil 3D Performance Settings:
Adjust Settings: Check the Civil 3D performance settings, such as disabling hardware acceleration temporarily or adjusting display settings, to see if this reduces the likelihood of errors during batch processing.
6. Testing Environment:
Create a Test Environment: Set up a test environment where you can simulate the batch process with a subset of files. This can help you identify specific bottlenecks or issues in the script before running it on all 500+ files.
7. Consider Third-Party Tools:
Third-Party Batch Tools: Some third-party tools designed for batch processing in AutoCAD and Civil 3D offer enhanced capabilities for large projects. Tools like AutoCAD's AutoScript or Civil 3D Batch Plot might offer better stability for extensive batch operations.
By using these strategies, you should be able to overcome the limitations of the batch save utility and ensure that your weekly batch processing tasks run smoothly. If you go the Dynamo route, you'll have more flexibility and the ability to fine-tune the process to your needs.

0 Likes
Message 3 of 3

GTVic
Advisor
Advisor

I'm not sure I would trust the batch script or batch plot process with Civil 3D. When you properly launch Civil 3D from the standard shortcut there are a number of parameters on the command line to ensure Civil 3D loads properly as shown here:

 

"C:\Program Files\Autodesk\AutoCAD 2023\acad.exe" /ld "C:\Program Files\Autodesk\AutoCAD 2023\AecBase.dbx" /p "<<C3D_Metric>>" /product C3D /language en-US

 

Batch script and plot may just be running acad.exe without the appropriate command line and profile. In that case you may also be relying on the Civil 3D object enabler (which could be out of date or buggy), for modifying Civil 3D entities and other Civil 3D functionality.

 

I would suggest trying SAVEAS instead of QSAVE and possibly a LISP routine instead of SETBYLAYER.

 

Have a look at this post:

https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/running-a-script-through-a-batch-fil...

 

 

0 Likes