Batch Processing Using AcCoreConsole Now Here (AutoCAD .net API)

_config.yml

Batch Processing Using AcCoreConsole is now here.

What is AcCoreConsole?

  1. It is a command line version of AutoCAD without a user interface.
  2. It allows us to batch process AutoCAD drawings super fast.

Example Demonstration:

  • 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:

  • Normal human beings probably will not understand the below. You’d have to be a geek and familiar with the Autocad .net API to make any sense of the below.
  • 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):

  1. Write a custom .net DLL (or ARX if you prefer).
  2. Write a script file to load this dll and to apply it to a drawing, and to add the parameters your dll requires.
  3. Apply that particular script file to all 500 of your drawings using Scrip Pro 2.0.
  4. Use AcCoreConsole to do the heavy lifting. It is light weight and fast and ideally suited to batch processing.
  5. Make yourself a cup of coffee – and by the time you are done, your files will have been updated.
  6. Check the log files to ensure everything went smoothly.

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;
  • I actually obtained the code from Kean.
Written on October 28, 2017