AutoCAD

  • For those of you who were unable to attend various Developer Track sessions at this year's Autodesk University (or would just like a refresher for sessions you found useful), my team is beavering away at recording our various AU sessions as DevTV episodes. As a quick taste of how they'll (most likely) look, here's the first: Stephen Preston's popular "AutoCAD .NET Basics" session, which went by the session ID of DE205-4, this year. Here it is for view and for download (139.1 Mb). It's possibly a slightly larger session to stream or download than you may have seen in the…

  • I've often seen the question, over the years, of how to draw text in the plane of the screen, even when the current view is not planar to the current UCS. This ability to "screen fix" text has been there, but has required a number of sometimes tricky transformations to get the right behaviour. Well, during a recent internal discussion I became aware of a really handy facility inside AutoCAD which allows you to dependably draw screen-fixed text without jumping through hoops. In this simple example, we're implementing a DrawJig - a jig that doesn't host an entity but allows…

  • I was pleasantly surprised the other day to find that the "permanent object deletion" API I mentioned back in this post - and had marked as only being available in ObjectARX - was also exposed in the .NET API to AutoCAD 2009. What better way to celebrate the good news than to put together some test code and post it to my blog? ๐Ÿ™‚ So, for a Thanksgiving/pre-AU treat, here's some information on making use of the Database.ReclaimMemoryFromErasedObjects() method to - surprisingly enough - reclaim memory from erased objects. Firstly, why is this even needed? Well, when you erase an…

  • There's just one week to go before this year's Autodesk University. If you need more accuracy than this Shaan's here to help. ๐Ÿ™‚ I'm going to be pretty busy with last-minute (well, last-week) preparation for the event, but will try to post the odd item of interest. For those of you who won't be in Vegas for AU 2008, please do keep checking this blog: I expect to keep posting during the course of the week which will hopefully prove to be of interest whether you were able to attend or not. One month ago I mentioned an AU Unplugged…

  • This post extends the approach shown in this previous post to implement a realistic editing and storage mechanism for application settings. It uses the .NET PropertyGrid control to display a custom class, allowing editing of a number of properties. This class is also serializable, which means we can use the .NET Framework to save it out to an XML file on disk. Some readers may have their own approaches to saving custom application settings, whether in the Registry or elsewhere: this post is primarily about displaying properties rather than providing a definitive "how to" for storing custom application settings. I…

  • A big thanks to Viru Aithal, from our DevTech India team, for providing the code that inspired this post. Update: it turns out I didn't look deeply enough into the origins of the code behind this post. The code that inspired Viru's code that inspired mine came from our old friend Mike Tuersley, who's delivering a class on customizing the Options dialog at this year's AU (in just over a week). Thanks, Mike! ๐Ÿ™‚ One way that applications often want to integrate with AutoCAD is via the dialog displayed by the OPTIONS command. Luckily it's relatively easy to add your…

  • This topic is a little on the advanced side - it requires the use of C++ and some knowledge of COM - but I felt it was worth covering, as you can get some interesting results without a huge amount of effort. Since we introduced the Properties Palette (once known as the Object Property Manager (OPM) and otherwise referred to as the Properties Window) back in AutoCAD 2004 (I think it was) it has become a core tool for viewing and editing properties of AutoCAD objects. In AutoCAD 2009 we have taken the concept further, allowing properties to be added…

  • In this previous post we looked at a basic task dialog inside AutoCAD and exercised its various capabilities without showing how they might be used in a real application. This post goes beyond that to show how you might make use of the TaskDialog class to provide your users with relevant information at runtime that helps them decide how best to proceed in certain situations, effectively increasing your application's usability. The specific scenario is this: if the user selects a lot of entities - too many for our command to handle quickly - we want to show a dialog that…

  • This is a topic I've been meaning to get to for some time... as I finally had to research it for a side project I'm working on, I decided to go ahead and post my findings here. AutoCAD 2009 makes heavy use of task dialogs, which are basically message-boxes on steroids. MSDN contains documentation on Microsoft's implementation of task dialogs, although our implementation is a little different. Why bother with these new task dialogs? They provide a way of asking more user-friendly questions using actual actions as answers rather than yes/no/cancel etc. It's a bit like the way I now…

  • This comment came in from a developer on a previous post: We still do all our stuff w/C++/STL/COM/MFC; lots of custom entities and object behavior - for Civil 3D/Land Desktop/Map -- hence, I'm not Dot Netted. The predominate explanation I've heard to move from C++ to .Net is that UI is maybe easier to write...but we've had all that nicely standardized for years (although I could still strangle someone at MS at least once a week/month.) We tend to minimize external API use, whether ObjectArx/Win32/MFC, and try to have portable code. Granted, it's mostly Win32 dependent and perhaps lacks the…