Author Topic: VBA and AutoCAD Automation (2018)  (Read 5136 times)

0 Members and 1 Guest are viewing this topic.

karrotbear

  • Mosquito
  • Posts: 2
VBA and AutoCAD Automation (2018)
« on: December 17, 2018, 07:54:39 PM »
Hello everyone.

Firstly a little about myself. I work as a Road Designer and we typically do our final drawings in AutoCAD. Lately I've been trying to come up with more efficient solutions for doing grunge work (updating title blocks, changing plot stamps etc etc) so I've come up with a spreadsheet solution that does the following:
1. Outputs from 12d are has a set naming convention, with data within each output (in .dwg format) requiring extraction. Namely a list of text in a certain layer.
2. The sheet then processes the outputs by purging and swapping some layers around.
3. The sheet then inserts xrefs (longsections and xsections) into the respective drawings (after being created by the user)
4. The sheet then draws some dimlines on working plans to show extents of works etc.

Now on small jobs the sheet works well. But once you have 60 or so drawings that require processing it starts getting tedious, because currently each drawing is loaded into AutoCAD and then operations performed on it, and then saved/quit. Which then locks the PC from use (the whole idea is I can hit the button and do something else while the drawing processing is happening).

Is there any way to 'lazy load' or create some sort of database of each AutoCAD output without actually loading the file (in VBA)? Typically I only load the file to find two entries, a low value and a high value, and then purge and save the drawing.

I've had a cursory glance at the forum to see if this topic has been covered anywhere, and I've been trawling the net for some time to see if this question has been asked before but couldn't find anything.