Overrules
-
Thanks to Stephen Preston for providing the prototype that I extended for this post. He put it together in response to a suggestion for a new Plugin of the Month from Shaan Hurley, who thought a "dimension finder" tool for locating overridden dimension text would be useful for people. This code may well develop into that tool, but for now it's being posted in its current, admittedly still somewhat rough, state. The below code implements a couple of overrules using the mechanism introduced in AutoCAD 2010: one to highlight dimensions in a drawing which have had their text manually overridden…
-
In the most recent part of this series, we looked at one possible mechanism to allow points to be moved along a network of curves, extending the first part in this series, which focused on the case of a point on a single curve. This post is going to focus on something slightly different: it's going to look at making the points added to a particular curve be associative to that curve – i.e. travel along with it as the curve is moved – and in the process we're going to adjust the way we link between our objects, by…
-
In the last post we looked at some code to create a point on a curve, and make sure it stays on that curve when edited. In this post we're extending that code (albeit slightly) to work with a network of curves: the idea is that any curve which has a point created on it becomes a candidate for any point to snap onto as it moves around. This could clearly be extended to provided a better way of specifying the curves forming the network, of course. Here's the updated C# code, with the modified/new lines in red (the full…
-
Over the weekend I put together a little prototype to prove a concept for an internal project I'm working on. The idea was to force a point onto a curve (meaning anything inheriting from Curve in AutoCAD, such as Arc, Circle, Ellipse, Leader, Line, Polyline, Polyline2d, Polyline3d, Ray, Spline, Xline…), so that when the point is moved it snaps onto the curve to which it's assigned. The solution I've put together is far from being complete – which is partly why I'm planning on making this a series, so I can flesh it out a little further in further posts…
-
Thanks to Stephen Preston, who manages our DevTech Americas team, for donating the samples from his upcoming AU class for posting on this blog. Let's start the week with a nice simple sample: the first from Stephen's AU class. Looking back even to the first C# overrule sample I posted here, I can see that most have been quite complex, mainly because they've performed complicated things. Today's code implements a very simple DrawableOverrule which changes the way lines are displayed in AutoCAD: Here's Stephen's C# code, reformatted to fit the blog: using Autodesk.AutoCAD.Runtime; using Autodesk.AutoCAD.ApplicationServices; using Autodesk.AutoCAD.DatabaseServices; using Autodesk.AutoCAD.GraphicsInterface; …
-
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…
-
This is a nice sample provided by Stephen Preston, who manages DevTech's Americas team. Stephen has put this together in anticipation of his upcoming AU class on the overrule API introduced in AutoCAD 2010. [I know the final class list has not yet been announced, but Stephen is co-owner of the Customization & Programming track at this year's AU and presumably has the inside skinny on the selected classes. Which means he has a head-start on preparing his material, lucky fellow. :-)] The sample allows the user to enter a text string that it uses to highlight any block containing…
-
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…