AutoCAD


  • DesignScript now available for download from Autodesk Labs

    I'm really excited about this. A new programming language and environment for AutoCAD is now available for download on Autodesk Labs (and here's the announcement on Scott's blog, in case, and you should also be aware of this login/download issue – something I just ran into myself). Way back when, I helped integrate the initial incarnation of DesignScript – although at the time we were using its working name, D# – inside AutoCAD. The father of the language, Robert Aish, was put in touch with me on October 17th 2008 and by the time I headed for Las Vegas on…


  • Animating transient AutoCAD graphics using .NET

    A developer had an interesting requirement that I thought I'd spend some time looking at: to animate transient graphics inside AutoCAD according to data they've pulled in from an external simulation system. It's clear that AutoCAD is really not an animation platform – we have other products that are better suited to working in this way – but I thought it would be interesting to see what was possible. I decided to take the implementation shown in this previous post and throw in some code to animate a few different things: Change the per-vertex colours of our transient box These…

  • This question came in recently by email: I have reached a snag when trying to find the boundaries of external references that have been "xclipped" by the user. Or, to be more precise, I can't even really find the data telling me whether or not the external reference has been "xclipped" at all. I'm wondering if you have any idea how or where I could find this data. While I found this previous post showing how to perform an XCLIP, I couldn't find anything showing how to query for XCLIP information. Here's some C# code that does just that for…


  • Adding per-vertex colours to a transient AutoCAD shell using .NET

    In the last post, we introduced some code to generate transient graphics using WorldGeometry.Shell(). In this post we'll make one simple addition: we'll add per-vertex colours, to see the effect on the generated box. We're not going to perform complex calculations to determine the appropriate colours for each vertex: we'll just use the index of the vertex itself, in much the same way as we did for the faces. As faces and vertices in no way match, index-wise, we should see some interesting effects. Here's the modified C# code. There is only one addition to the previous code: a call…


  • Generating a transient box inside AutoCAD using .NET

    Since posting about the ability to display transient graphics as an ongoing feature that can react to mouse input, I've been thinking of the steps that would be needed to generate a custom gizmo comparable with AutoCAD's viewcube. The post starts to go in that direction by displaying a couple of types of transient graphics in AutoCAD as a "standard" feature: firstly we're going to show screen-fixed text (with code pulled directly from this post) and then we're going to place a a transient box in the drawing itself. This may be pre-cursor to displaying a box-like gizmo, but then…


  • Overriding the grips of an AutoCAD polyline to maintain fillet segments using .NET

    Many, many thanks to Massimo Cicognani for contributing the code in today's post. Massimo contacted me as he was working through some issues with his implementation and then kindly offered to share it with this blog's readers. We've looked at a few different types of overrule on this blog, in the past, and even taken a look at a grip overrule or two. Massimo's much more advanced grip overrule works with a very particular type of polyline: those that alternate between straight and arc segments (with the first and last segments being straight). This might sound a touch specific, unless…

  • This question came in by email, last week: I'm trying to reverse the direction of a polyline thought the API, but I didn't find something in the documentation nor in the web. (Even nothing on your blog.) Can you help me? I also didn't find anything in the public API, although that doesn't mean there isn't something I've missed (I seem to be on a bit of a roll in that respect, lately :-S :-). A couple of thoughts/comments on this problem: Ideally we don't want to create a brand new object, as on the one hand there may be…


  • Help for AutoCAD 2013 updated

    For the first time ever (apparently – I don't remember this kind of detail) there has been a mid-cycle update to AutoCAD 2013's online Help system (comparable updates have been made for AutoCAD LT 2013 and AutoCAD Mechanical 2013). The updates include more than just new content – there have been significant enhancements made to the search mechanism, for instance. One feature I think readers of this blog will find particularly helpful is the ability to filter for developer-oriented content: And be sure to "Include Web Results" if you want the results to include content from this blog, of course.…


  • Creating a selection filter that finds dynamic blocks in AutoCAD using .NET

    An interesting question came in via email from Rob Outman. He's interested in applying a selection filter when the user selects dynamic blocks. This is straightforward for unmodified dynamic blocks – just as with standard blocks, you can filter on the block name very easily – but it works less well on dynamic blocks whose properties have been modified at an instance level. Essentially what happens is this: if you select a block reference to a dynamic block in the AutoCAD editor and then use (for example) the Properties window to edit some of the custom properties associated with that…


  • Creating reactive, transient AutoCAD geometry using .NET

    This is a really interesting topic. At least I think it is – hopefully at least some of you will agree. 🙂 The requirement was to create selectable – or at least manipulatable – transient graphics inside AutoCAD's drawing canvas. As many of you are probably aware, transient graphics are not hooked into AutoCAD's selection mechanism. This is mostly fine, but if you want to implement a ViewCube-like gizmo that manipulates the view or drawing settings in some way, it's hard to do so without the ability to react to the current cursor position is and what's happening with the…