Custom objects
-
This is really cool. Fellow architect on the AutoCAD team, Jiri Kripac – who originally wrote AutoCAD's "AModeler" facet modeler and is the driving force behind AutoCAD's Associative Framework – has written a really interesting ObjectARX sample to perform an associative fillet between two curves. Given Jiri's background, this is as close to a canonical sample for implementing an operation using the Associative Framework – in this case by creating a custom AcDbAssocActionBody – as you're likely to find. Here's a video showing this custom fillet in action, and how it can be used with parameters and expressions to do…
-
This week I will mostly be posting about Overrules. [For those of you who haven't seen The Fast Show (called Brilliant in the US), this is an obscure reference to a character named Jesse. :-)] Aside from this post, Stephen Preston has sent me the samples he's put together for his AU class on this topic, so expect some serious plagiarism (although now that I've given him credit I suppose it's not really plagiarism :-). Here's a question I received recently by email: Is there some posibility to write something in some of your next blogs about how to get…
-
I might also have called this post "Overruling AutoCAD 2010's entity display and explode using Boo", as it complements the equivalent posts for C#, F#, IronPython and IronRuby, but I felt it appropriate to combine the post with an introduction to what Boo is all about. What is Boo and how did I come to look into it? Knowing of my recent interest in the various scripting technologies being made available for .NET, a colleague at Autodesk recently pointed me at the Boo programming language (and here is the official page for the language, including its various downloads). First, to…
-
As mentioned in this previous post, where I gave the same treatment to IronPython, I've been trying to get display and explode overrules defined in IronRuby working properly in AutoCAD. IronRuby is still at version 0.3, so this effort has been hindered by a number of CLR interop bugs (it turns out). I finally managed to work around these issues thanks to Ivan Porto Carrero, who is just finishing up his book, Iron Ruby in Action, and has been working with IronRuby since pre-Alpha 1 (brave fellow). Ivan's help was invaluable: he ended up downloading and installing AutoCAD 2010 to…
-
I've been meaning to get to this one for a while. This post takes the OPM .NET implementation and shows how to use it to allow modification of data persisted with an object: in this case we're going to use the XData in which we store the "pipe radius" for the AutoCAD 2010 overrule sample we've recently been developing. To start with, I needed to migrate the OPM .NET module to work with AutoCAD 2010, which meant installing Visual Studio 2008 SP1. Other than that the code migrated very easily, and the project (with the built asdkOPMNetExt.dll assembly) can be…
-
I am really starting to love the new Overrule API in AutoCAD 2010, and I still feel as though I'm just scratching the surface. This question came in overnight from Danny Polkinhorn (thanks, Danny! 🙂 : It's exciting to see a very usable implementation of 'custom' objects in .NET. Obviously, this implementation protects what could be proprietary business intelligence from being sent around, but it brings up a question. What process would you use to 'explode' these elements so that you could send the drawing to someone without your code, but with the custom elements in it? My first thought…
-
In the last post we looked at some code that attaches additional data to individual entities, allowing them to be drawn independently with different visual properties via the new Overrule API in AutoCAD 2010. A couple of comments – one from Qun, who provided the original F# sample, and one from Tony Tanzillo – have prompted me to optimize the code somewhat. Tony pointed out, very validly, that as the previous code registers its overrule against Drawable objects it will get called for every entity (and various objects besides) which could clearly impact performance. Qun pointed me to some interesting…
-
In the last post we looked at some C# code to customize the display of all Lines and Circles within AutoCAD, adding a thickness (or a diameter) to make them look more like pipes. This was, in turn, based on this F# post. The previous code implemented an overrule that allowed us to insert our own graphics for every instance of the types of object we cared about. [A quick note on the previous implementation: we actually register the overrule to be called for all "drawable" objects: the inheritance tree for the Circle class is: Drawable –> DBObject –> Entity…
-
The code in this post is a direct port of the F# code in this previous post, which was entered by Qun Lu in the recent F# programming contest. Someone – very validly - commented on the fact the post involved both a new language and a new API, which was probably pushing things a little from a learning perspective. 🙂 Without repeating my various comments in the previous post, I will reiterate the fact that this API is extremely interesting for developers who wish to customize the appearance and behaviour of standard AutoCAD objects without going through the pain of implementing full…
-
This post is one of the winning entries of the F# programming contest started at the beginning of the year. It was submitted by an old friend of mine, Qun Lu, who also happens to be a member of the AutoCAD engineering team, and makes use of a new API in AutoCAD 2010: the somewhat ominously-named Overrule API. The Overrule API is really (and I mean really, really) cool. Yes, I know: another really cool API in AutoCAD 2010? Well, I'm honestly not one to hype things up, but I do have a tendency to get excited by technology that…