AutoCAD .NET
-
Late last week I received an interesting email from Bruno Saboia, who's been experiencing some performance issues with code he'd written to return all the objects of a particular type – in his case, Lines – from the model-space of the active drawing. We exchanged a few emails on the topic, and Bruno kindly allowed me to post his code and my suggestions for changes. In today's post, we're going to look at both the code and my suggestions, while in the next post (in this mini-series, at least) we'll look at a simple execution framework that can allows you…
-
Today is the official launch of 2014 family of products. AutoCAD 2014 will be available in the coming days to customers around the world. You'll no doubt find lots of information on the interwebs regarding the product's features, so I'm going to focus specifically on the opportunities – and requirements – the new release presents to developers. Firstly, ADN members should refer to the (as ever) thorough information produced by the DevTech team and posted under the "Events" section of the ADN website. I expect the AutoCAD DevBlog will be making much of this available to a broader audience over…
-
OK, here goes: my first (public) attempt at integrating the brand new Kinect Fusion functionality – made available this week in v1.7 of Microsoft's Kinect for Windows SDK – into AutoCAD. There are still a few quirks, so I dare say I'll be posting an update in due course. As mentioned in the last post, I've been working on this for some time but can now show it publicly, as the required SDK capabilities have now been published. As part of this effort, I've gone ahead and made sure the other Kinect samples I've written for AutoCAD work with this…
-
Everyone who uses AutoCAD – even if they use it exclusively in one or the other mode – knows that it's capable of being used to generate both 2D drawings and 3D models. Not everyone realises there are actually two distinct graphics systems in the product, however. (At least at the time of writing, talking about AutoCAD 2013… I'm not making predictions, for people reading this from the future. 🙂 The 2D graphics system is known as WHIP and has been around – albeit with regular enhancements – since the days of R13. You know if you're using WHIP if…
-
As predicted in the first post in this series, today's post looks at a slightly more robust and user-friendly approach for determining the point on a surface found by firing a ray normal to a selected X,Y point in the plane of the current UCS. Here's the updated C# code that now includes an additional command called POXY (that's a shortened form of PointOnXY, but will hopefully bring a smile to the lips of British readers): using Autodesk.AutoCAD.ApplicationServices; using Autodesk.AutoCAD.DatabaseServices; using Autodesk.AutoCAD.EditorInput; using Autodesk.AutoCAD.Geometry; using Autodesk.AutoCAD.Runtime; using AcDb = Autodesk.AutoCAD.DatabaseServices; namespace SurfaceIntersection { public class Commands {…
-
When I woke up this morning I didn't expect to write a post on this topic, but then I found a kind email in my inbox from an old friend and colleague, Ishwar Nagwani, with some code he'd written and wanted to see posted. Ishwar had generated the test code in response to the following question from a member of the ADN team: This question is to get the corresponding Z of a surface/solid, given a point of XY. This refers to the absolute coordinate, instead of the point on param space. I seem not to find a direct way…
-
Viru Aithal from the ADN team posted a link to this survey on the ADN DevBlog and asked that I post it here, too. The survey will help us determine your priorities for developer-oriented documentation, so we definitely appreciate the time you take to fill it out. [You might even find out about documentation resources of which you were previously unaware – there's quite a list in there.] My inbox is nearly back under control after my week of holiday, so I'll certainly be posting more during the course of the week. photo credit: splorp via photopin cc
-
As a follow-on from this recent post, I decided to take a stab at a more generic solution for managing XData that should remain unique – i.e. attached to a single object – inside an AutoCAD drawing. This was prompted by an internal discussion that included a long-time colleague, Randy Kintzley, who suggested the approach taken in this post. (Thanks also to Tekno Tandean and Davis Augustine for adding valuable comments/feedback.) Randy's suggestion was to avoid per-command event handling completely by adding an additional piece of XData – the handle – to objects that need to be managed in this…
-
This question came in day or two ago: "I attach an XData to some AutoCAD entities. When the AutoCAD entity is offset by OFFSET command, the XData is cloned in the offset entity. What's the way to control(stop) the cloning of my XData in OFFSET command?" This is an interesting one. Many applications rely on External Entity Data (XData) providing unique references from AutoCAD objects to other locations, so when objects with XData attached get copied, it either needs to be removed or updated to refer to something different (an identifier to a new record in an external database table,…
-
A comment on the last post made me think it's probably worth diving into LINQ a bit further, as there's clearly interest out there. Now I don't actually use LINQ very much but whenever I do I tell myself I ought to use it more – it's really very useful. A lot of LINQ is derived from the world of Functional Programming – in that it allows you to use higher order functions to manipulate data – and it's really just another way in which .NET languages have been influenced by FP (and have evolved to incorporate its techniques in…