AutoCAD
-
Thanks to Virupaksha Aithal, from DevTech India, for providing the technical response to an ADN member than inspired this post. When working with the Point2d and Point3d objects from AutoCAD's .NET API it's common to use the in-built collection types, Point2dCollection and Point3dCollection. Neither of these objects provides the capability to sort their contents (and, in any case, sorting would mean different things to different people when it comes to containers of objects with multiple data entries). So how can you sort one of these collections? The answer is fairly straightforward: you convert them to a .NET array, sort them…
-
From time to time I listen to the .NET Rocks show – I don't get the chance to listen every week, but I do browse through the RSS items I get for the show episodes and find some time to put those I find of particular interest on in the background while I'm working on something else. Yesterday's episode caught my eye, as it focused on the nKinect project, exposing the Kinect's capabilities to .NET. And 'm really (and I mean really) excited about the Xbox Kinect. I mentioned it in passing in a post from last March (it was…
-
Thanks for Chris, Dan and Dale for pointing out the obvious issue(s) with my last post. Let's just blame it on a few holiday cobwebs needing brushing away during the first week back in the saddle. 🙂 The main issue with my previous implementation was that I'd somehow forgotten that Database.Insert() allows you to insert into a named block definition. This simple function does all my previous, manual approach did and more. The secondary issue – but still very important to those using annotation scaling – is that the previous code does not work for annotative blocks, as Dan very…
-
Important note: the code in this post – while potentially interesting, at a certain level – has been superceded by the code in the following post. Please go ahead and use that simpler, more complete implementation instead. This question came in, over the holidays, that seemed like it was worth addressing: How do I get an external DWG into the blocks table as a block definition? I started by quoting this ancient (at least in terms of this blog) post, but it turned out only to be of partial help: the problem is that the external DWG does not contain…
-
As Scott has announced over on his blog, January's Plugin of the Month, DrawOrder By Layer, is now available on Autodesk Labs. I first posted the code for this very useful plugin back in October, and this version includes only a very minor change from that one (for performance reasons it now only works with modelspace layers). A huge thanks to Terry Dotson from DotSoft for generously donating this plugin. After the original post, a few people provided feedback on user interface enhancements they'd like to see in the tool – thanks for taking the time to do so, those…
-
As promised, today's post delivers a simple application that provides a user-interface for the command implemented in this previous post. I chose to implement the UI as a WPF user control which is then hosted by a standard AutoCAD palette. Aside from its core function – to allow composition of transformation matrices to be applied on an AutoCAD object – it demonstrates a couple of handy tips for working with Palettes: Separate the core functionality from our UI, using SendStringToExecute() to call it This will reduce the chance of issues related to Document vs. Session context, document-locking, etc. If you…
-
As promised in the last post and based on the overwhelming feedback in the one before that, today we're starting a series on how to transform AutoCAD geometry. Before developing a fancy modeless GUI to make this really easy, we need a base command that can do the hard work. What's needed from our basic command is the following: Get a single entity from the pickfirst set (which will help us when calling the command from our modeless UI) If there isn't one selected, ask the user for it Get the property name to transform Only for writeable Point3d and…
-
I've arrived in Munich for our German DevDay + DevLab. There's lots of snow, but luckily I didn't get delayed: I was a touch paranoid after my trip to AU, and then having to fly two legs to get here. Therein lies a story: it's not usually needed to take two planes to get from Switzerland to Munich, of course, but I had a 30-minute flight from Geneva to Zurich before connecting to a 50-minute flight form Zurich to Munich. As far as I recall this was the most cost-effective option when I booked the flight. My home is actually…
-
One AU evening at the bar, I was chatting to a couple of developers who suggested covering some fundamental mathematics on this blog: their respective career paths had not involved any formal (or perhaps recent) studies of certain important areas of mathematics, especially related to core linear algebra concepts such as matrix multiplication. Part of me said, "what a great idea", another part said "I wonder what resources are already out there" and the last said "oh man, I don't remember how all that stuff actually works". 🙂 Before I start dusting off some of that well-buried geometrical knowledge, I…
-
As many of you may now be aware, much of the content recorded at this year's Autodesk University is now available on the AU website. You'll find the recording of my AU Virtual session, "Getting to Know the AutoCAD® Plug-ins of the Month", as well as material from the two physical sessions I presented, "Point Clouds on a Shoestring" and "Integrate F# into Your C# or VB.NET Application for an 8x Performance Boost". In fact, much to my surprise, the "Point Clouds on a Shoestring" session (which turned out to be my highest-rated session) ended up being recorded, and can…