Batch Processing Using AcCoreConsole is now here.
What is AcCoreConsole?
- It is a command line version of AutoCAD without a user interface.
- It allows us to batch process AutoCAD drawings super fast.
Example:
- Let’s say I have 500 drawings. (This is a prime candidate for batch processing).
- Now let’s say I have to apply a tedious and repetitive change to each of those drawings.
- This would take a long time to do manually. You would have to employ a CAD monkey to do this. No more! You can automate everything!
Watch the Video: It is will explain the technical stuff below:
For Geeks Only:
- If you have any questions, please feel free to ask!
Geek-speak: How does it work? (It might not make sense to most of you guys but that’s ok – all you need to know is that you CAN automate things if you want to):
- Write a custom .net DLL (or ARX if you prefer).
- Write a script file to load this dll and to apply it to a drawing, and to add the parameters your dll requires.
- Apply that particular script file to all 500 of your drawings using Scrip Pro 2.0.
- Use AcCoreConsole to do the heavy lifting. It is light weight and fast and ideally suited to batch processing.
- Make yourself a cup of coffee – and by the time you are done, your files will have been updated.
- Check the log files to ensure everything went smoothly.
- Important: Ensure you DLL is in a “trusted location”.
Here is my ScriptFile:
(Remember when pasting that you have to add the .scr extension)
My .net DLL:
- Just a standard DLL which changes the attribute values of a particular block. You’ll have to get rid of the pesky reference to AcMgd but otherwise it is basically the same as the below. Kean says it better than I could ever say it.
- Of course you will have to change the above script file to suit the DLL command name, and the DLL location, as well as the particular block name and tag and new attribute values that will be particular to your project.
- You can access the Document with the following code:
Document acDoc = Autodesk.AutoCAD.ApplicationServices.Core.Application.DocumentManager.MdiActiveDocument;
- Here is Kean’s code.
If you have any questions: Go ahead and call me!
Leave a Reply