AutoCAD
-
A question came in on a previous post: Hello, I write applications for Autocad Map and Civil3d platforms, mostly with ObjectARX. I would like to do more with .NET but so far the main reason preventing this is not having the NETUNLOAD command.. With arx I can just arxunload and arxload the application for modifications in a second. But with .NET I have to restart the heavy environment and do all kinds of lengthy initializations before being able to try even small changes in code, this can take a minute or more.. Maybe it is possible to create an utility,…
-
This is the third part of the series documenting my recent interview with John Walker. Where the first part looked at the early history of the company and the second looked at the architectural evolution of AutoCAD and its APIs, this part focuses on Autodesk's business strategy and focus on its eco-system. I have not linked to terms previously linked to in the first part of the series, which should also be referred to for typographical conventions, if they're not clear. Part 1 - Autodesk's early history Part 2 - AutoCAD's architecture & APIs Part 3 - Autodesk's eco-system and…
-
The following question came in as a comment on this previous post: Your example above shows how to create a property type filter, how do you add layers to a group type filter (LayerGroup class)? I can create the group filter but can't figure out how to add layers to the group. The filterexpression method is available but doesn't seem to work (at least not like with the LayerFilter object) To tackle this, let's start by looking at the documentation on the LayerGroup class in the .NET Reference (currently part of the ObjectARX Reference): LayerGroup is derived from LayerFilter and…
-
This is the second part of the series documenting my recent interview with John Walker. Where the first part looked at the early history of the company, this part focuses more on the architectural evolution of AutoCAD and its APIs. I have not linked to terms previously linked to in the first part of the series, which should also be referred to for typographical conventions, if they're not clear. Part 1 - Autodesk's early history Part 2 - AutoCAD's architecture & APIs Part 3 - Autodesk's eco-system and strategy Part 4 - Past and future opportunities AutoCAD's architecture & APIs…
-
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 AppDomain.AssemblyLoad event-handler. To recreate the NETLOAD command, all you need to do is call Assembly.LoadFrom(), passing in the path to your assembly. Here's some C# code to demonstrate this: using Autodesk.AutoCAD.ApplicationServices; using Autodesk.AutoCAD.EditorInput; using Autodesk.AutoCAD.Runtime; using System.Reflection; namespace LoadModule { public class Commands { …
-
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 option, once again, of dipping into my magic folder of code generated and provided by my team. The technique for this one came from a response sent out by Philippe Leefsma, from DevTech EMEA, but he did mention a colleague helped him by suggesting the…
-
On Thursday of last week (September 4th, 2008, for those people accessing this post sometime in the distant future :-), I had the great honour of meeting with John Walker, one of Autodesk's founders and its former CEO. I've known for some time that John lives in the Neuchâtel area, and it turns out he lives just 10 minutes' drive from my home. I decided quite recently to get in touch with John and suggest I interview him for this blog, and I was delighted when he accepted. Not only was John very generous with his time - we talked…
-
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 application. For an example, see this C# code: using Autodesk.AutoCAD.ApplicationServices; using Autodesk.AutoCAD.EditorInput; using Autodesk.AutoCAD.Runtime; namespace PreventLoad { public class Commands : IExtensionApplication { public void Initialize() { // This will prevent the application from loading …
-
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 command), but also to hide the fact we're sending commands to the command-line to do so. While we were discussing, I remembered an old friend, the NOMUTT system variable, which allows almost all command-line noise to be filtered out - even the "Command:" prompt disappears.…
-
This just may be the catalyst I needed to get around to installing Visual Studio 2008: the availability of the F# September 2008 Community Technology Preview. This takes F# an important step closer to being a full .NET citizen, with the first release delivered by Microsoft's Developer Division (the previous releases having been delivered by Microsoft Research). It's not required to use VS 2008 with this release of F#, but that's the version that's been targeted for the IDE integration, naturally enough. I've been holding off from installing VS 2008 for some time - mainly as ObjectARX applications still require…