AutoCAD .NET
-
A member of our AutoCAD Engineering team pointed me at this very cool tool - the Framework Design Studio. The wiki doesn't really do it justice, so here's a post describing what the tool does. I also found it a little trick to get to the download, so here's the latest version at the time of posting. So what's so cool about this tool, as a developer working with AutoCAD? It seems as though the tool was primarily intended to allow platform developers to identify when their changes impact API compatibility, but it's also useful for developers working on a…
-
For the last 5 years or so, Autodesk has gathered feedback from our developer community regarding the API features you would most like to see in future Autodesk products. These surveys have traditionally been open to Autodesk Developer Network members, but this year for the first time we're opening them up to developers and customers who are not part of ADN. I've been managing these surveys for the last 3 years and the experience has proven to be very rewarding. Every year we see a number of items get knocked off the various lists: our Engineering teams really appreciate the…
-
This post is the latest in the series of closer looks at the new APIs in AutoCAD 2009. It dips into the InfoCenter API, a .NET API allowing you to customize and drive the InfoCenter feature inside AutoCAD. To make use of this API you need to add Project References to two managed assemblies from the AutoCAD 2009 root folder: AcInfoCenterConn.dll and AdInfoCenter.dll. Here's some C# code that will display a balloon notification to your users: using Autodesk.AutoCAD.ApplicationServices; using Autodesk.AutoCAD.Runtime; using Autodesk.AutoCAD.AcInfoCenterConn; namespace InfoCenterApp { public class Commands { [CommandMethod("icb")] public void infoCenterBalloon() …
-
Thank you to Sreekar Devatha, from DevTech India, for writing this article for the recently published ADN Platform Technologies Customization Newsletter. This article talks about the new Ribbon API referenced in this overview of the new APIs in AutoCAD 2009. A complete sample demonstrating the use of this API is provided as part of the ObjectARX 2009 SDK, under samples/dotNet/Ribbon. Introduction Most of the AutoCAD® UI was redesigned in this release. Ribbon, Menu browser and Tooltips are some of the prominent UI features to list. As you might already know the UI enhancements are based on the new Windows® Presentation…
-
This post is the latest in the series of closer looks at the new APIs in AutoCAD 2009. It covers the Data Extraction API, a new .NET API allowing you to drive the Data Extraction feature inside AutoCAD. There is a very thorough C# sample included on the ObjectARX SDK (under samples/dotNet/DataExtraction), so I thought I'd focus on a much simpler example where we extract data from a single drawing. Here's the C# code: using System.Collections.Generic; using Autodesk.AutoCAD.ApplicationServices; using Autodesk.AutoCAD.EditorInput; using Autodesk.AutoCAD.Runtime; using Autodesk.AutoCAD.DataExtraction; namespace DataExtraction { public class Commands { const string path = …
-
An interesting request came in via a previous post followed up by a similar question came in via another post. The original problem was to rotate a rectangular polyline entity around its centre, and be able to continue rotating it afterwards. A few things were interesting to me: Rectangles are simply polylines between four points, so have no inherent concept of either a centre point or a rotation angle The obvious answer (to me, at least) being to calculate the centre and store the rotation as XData on the polyline To modify an entity graphically it makes sense to use…
-
This post takes a look at another topic outlined in this overview of the new API features in AutoCAD 2009. AutoCAD 2009 introduces the ability to embed the application in a standalone dialog or form via an ActiveX control. This capability has been around for a number of releases of AutoCAD OEM, but this feature has now been made available in the main AutoCAD product. The way the control works is to launch an instance of AutoCAD in the background (it should go without saying that AutoCAD needs to be installed on the system, but I've said it, anyway 🙂…
-
Back from a nice long weekend, although I spent most of it sick with a cold. I find this increasingly the way with me: I fend off illness for months at a time (probably through stress, truth be told) but then I get a few days off and wham. A shame, as we had a huge dump of snow over the weekend... we get white Christmases here every five years or so, but it's really uncommon to get a white Easter. I had a very interesting question come in by email from 冷血儿, who wanted to get the technique shown…
-
A big thanks to Scott McFarlane, from Geotropix, Inc., for sharing the code in this post. Here's an email I received from Scott: I was reading this blog entry on "Through the Interface" and some folks were asking about how to implement .NET combo box versions of the color and linetype ActiveX controls that are available. I just wanted to share a simple .NET implementation of a color combo box. The color combo is quite easy, really. The linetype one would be more difficult. Attached is the source code. This is just a generic color combo, that loads up with…
-
I had a question come in by email about how to find out the full path of a drawing open inside AutoCAD. Here's some C# code that does just this: using Autodesk.AutoCAD.Runtime; using Autodesk.AutoCAD.ApplicationServices; using Autodesk.AutoCAD.DatabaseServices; namespace PathTest { public class Commands { [CommandMethod("PTH")] public void DrawingPath() { Document doc = Application.DocumentManager.MdiActiveDocument; HostApplicationServices hs = HostApplicationServices.Current; string path = hs.FindFile( doc.Name, doc.Database, FindFileHint.Default …