Documents

  • In the original post in this series, we introduced a basic application to number AutoCAD objects, specifically blocks with attributes. In the second post we extended this to make use of a generic numbering system for drawing-resident AutoCAD objects, and in the third post we implemented additional commands to take advantage of this new "kernel". In this post we're going to extend the application in a few ways: firstly we're going to support duplicates, so that the LNS command which parses the current drawing to understand its numbers will support automatic and semi-automatic renumbering of objects with duplicate numbers. In…

  • One question that comes up from time to time is how to "gracefully" close all open documents inside AutoCAD. I use the term "gracefully" in quotes, as this does mean different things to different people. Let me first define what it means to me: Changes get saved to modified drawings Even if the drawing in question has never been saved before Which means you should expect to get some DWGs with names such as "Drawing1.dwg" saved to the working directory Active commands get cancelled, where possible Firstly, we need to define our command in the "session context", which means it…

  • This very good question came in by email from Patrick Nikoletich: I was wondering what the preferred method for overriding the default "Open" common dialog in AutoCAD 2007 would be? I can catch the event but can't send AutoCAD a command to cancel the request so I can launch my Win Form instead. This is quite a common requirement - especially for people integrating document management systems with AutoCAD. The simplest way to accomplish this - and this technique goes back a bit - is to undefine the OPEN command, replacing it with your own implementation. The classic way to…

  • Thanks once again to all of you who posted your congratulations on Zephyr's birth. I'm now getting back into the swing of things after my paternity leave, and I hope this is me restarting regular posts to this blog. I'm actually feeling quite energized (although it's probably nervous energy from sleep-deprivation 🙂 and have a number of topics I'd like to discuss over the coming weeks. First up is per-document data. Before talking about how best to segment data on a per-document basis, it's definitely worth talking about some of the history of this area – with respect to the…