Commands
-
I've been meaning to play around with the Python language for some time, now, and with the recent release of IronPython 2 it seems a good time to start. Why Python? A number of people in my team – including Jeremy Tammik and the people within our Media & Entertainment workgroup who support Python's use […]
-
Some of you may have stumbled across these previous posts, which show how to add custom context menu items for specific object types and to the default AutoCAD context menu. There is a third way to create and display context menus inside AutoCAD, and this approach may prove useful to those of you who wish […]
-
The question of how to perform a "NETLOAD" programmatically has come in a few times. Well, it turns out the answer - provided by someone in our Engineering team - is refreshingly simple. The NETLOAD command actually has a bare-bones implementation: the hard work of parsing the metadata defining commands etc. is done from an […]
-
I'm still a little frazzled after transcribing the 18,000 word interview with John Walker (and largely with two fingers - at such times the fact that I've never learned to touch-type is a significant cause of frustration, as you might imagine). I'm also attending meetings all this coming week, so I've gone for the cheap […]
-
This is an interesting one that came up recently during an internal discussion: During my module's Initialize() function, I want to decide that the module should not actually be loaded. How can I accomplish that? The answer is surprisingly simple: if you throw an exception during the function, AutoCAD's NETLOAD mechanism will stop loading the […]
-
Since posting three different options for Zooming to a Window or Entity inside AutoCAD, I've had a few discussions with a developer on how best to implement this cleanly. The requirement is to change the AutoCAD view via a smooth view transition (currently not exposed via any kind of view-modification API, only via the ZOOM […]
-
Another juicy tidbit from an internal Q&A session. The question... How can I throw an exception from within a modal form on mine inside AutoCAD, and catch it in the calling command? I have tried try/catch, but nothing seems to work. Here's my command definition: using Autodesk.AutoCAD.ApplicationServices; using Autodesk.AutoCAD.Runtime; using System.Windows.Forms; using MyApplication; using acApp […]
-
Thanks to Gopinath Taget, from DevTech Americas, for letting me know of this tool's existence. I've often battled to create Platform Invoke signatures for unmanaged C(++) APIs in .NET applications, and it seems this tool is likely to save me some future pain. The tool was introduced in an edition of MSDN Magazine, earlier this […]
-
I had an interesting question come in by email and thought I'd share it via this post. To summarise the request, the developer needed to allow command aliasing for their custom commands inside AutoCAD. The good news is that there's a standard mechanism that works for both built-in and custom commands: acad.pgp. acad.pgp is now […]
-
Most members of my team (DevTech) have a background in software development, having developed code professionally in previous jobs. People often join DevTech because they enjoy the variety and flexibility the role brings as well as the direct communication we have with the Autodesk development community. That said, we still like to hone our coding […]