AutoCAD .NET
-
Following on from the introduction to this series – and to the Kinect for Windows v2 sensor – it's time to take a closer look at some of the AutoCAD integration samples. At the core of the Kinect sensor's capabilities are really two things: the ability to capture depth data and to detect people's bodies in the field of view. There are additional bells and whistles such as audio support, Kinect Fusion and face tracking, but the foundation is really about RGB-D input and the additional runtime analysis required to track humans. Let's take a look at both of these.…
-
Last Friday Microsoft announced a preview SDK for Kinect for Windows 2. As the first public release of the SDK, it seems a good time to publish an initial set of samples for readers to play with. These are very much a work in progress – I tend to restart AutoCAD between Kinect Fusion captures, for instance, as otherwise I've been getting regular crashes – but they should give people a sense of what's possible. And while I haven't yet implemented certain capabilities we had before, I have gone ahead and snuck a few enhancements in (which you'll see in…
-
A few weeks ago I received the official retail version of Kinect for Windows 2 (having signed up for the pre-release program I had the right to two sensors: the initial developer version and the final retail version). After some initial integration work to get the AutoCAD-Kinect samples working with the pre-release Kinect SDK, I hadn't spent time looking at it in the meantime: the main reason being that I was waiting for Kinect Fusion to be part of the SDK. The good (actually, great) news is that it's now there and it's working really well. For those of you…
-
Over the last few months I've had a number of people ask me for an update to this 6-year old post on implementing a CAD standards plugin for AutoCAD (which in turn was based on code from an older DevNote created from a much older VB6 sample). Augusto Gonçalves from the ADN team very kindly made a start on this while I was out on vacation, providing a basic port that I've now just put a few finishing touches on. Very few changes were actually needed from the code in the original post, thankfully. Also, I did do my best…
-
Sometimes you just need to ease back into work after a few weeks off. So today I decided to have a go at integrating DogeSharp – a programming language on top of of .NET inspired by Dogescript – into AutoCAD. There was absolutely no reason to do so, other than to cause myself some amusement. Which is actually a pretty good reason, now that I think about it. For those of you who – like me – are almost completely unaware of Internet memes such as Doge, this was apparently a big one in 2013 and all started with this…
-
In this recent post we saw how to set our geographic location inside an AutoCAD drawing – essentially geo-referencing the model it contains – programmatically. In today's post we're going to capture a section of the displayed map and embed it inside the drawing, much as the GEOMAPIMAGE command does. In fact, we're going to use the GEOMAPIMAGE command to do most of the heavy lifting: we'll simply call the command and then pick up the created GeomapImage object to manipulate its settings, adjusting some image properties (brightness, contrast and fade settings) and having the map image display hybrid (aerial…
-
AutoCAD's geo-location API is a topic I've been meaning (and even promising) to cover for some time now. So here we are. 🙂 The below code sample is based on one shown at ADN's DevDays tour at the end of 2013 – for the AutoCAD 2014 release – but the API ended up not being fully usable (at least as far as I recall: someone should jump in and correct me if I have this wrong) until the 2015 release. I've taken the opportunity to use Editor.Command() to call a couple of commands synchronously – to turn on the GEOMAP…
-
We've been getting some interesting responses back from the AutoCAD Security Survey that has been posted over on the AutoCAD Futures beta forum. (If you haven't already responded, we'd appreciate you taking the time to do so: it'll probably take you less time than reading the rest of this blog post. Then please come back and finish reading this, too. 😉 The survey is intended to gauge whether the safeguards we first introduced in AutoCAD 2013 SP1 (and then further enhanced with the SECURELOAD mechanism in AutoCAD 2014) are properly understood and considered valuable. From some of the feedback we've…
-
In the last post we saw some code to exercise to two available system variable enumeration mechanisms in AutoCAD, SystemObjects.Variables and the new SystemVariableEnumerator class. Today we're going to take a closer look at these two mechanisms, briefly comparing their performance and results. I took some code from this previous post to measure elapsed time, deleting the "runs" database to simplify the code once I'd realised the performance was basically comparable. Here's the C# code, with the updated ESV and ESV2 commands which now create correspondingly named .txt files in c:\temp, rather than printing the results to the command-line (and…
-
On my flight across to Toronto, I took another look at the "What's New in AutoCAD 2015" section of the .NET API documentation and decided to dig into the new SystemVariableEnumerator implementation. I was particularly curious about this feature as there is already a way to get access to system variables via the Autodesk.AutoCAD.Runtime.SystemObjects.Variables collection. As an initial look at these two classes, I decided to put together a couple of simple variable iterator commands that use the same function to print out some information concerning the system variables exposed by each collection. Here's the C# code implementing two commands,…