Runtime
-
A big thank you to Jim Cameron from Dematic for providing the code for this post, and to Wayne Brill from DevTech Americas who helped him on his way via ADN support. I've made a few changes of my own to the code, but the concept is very much Jim's. Jim recently had a frustrating problem with a VLX application he wrote that depends – via (vl-arx-import) – on a .NET module. It turns out the module was not being demand-loaded properly, but this took some time to diagnose. In the past Jim used (arx) from LISP to detect the…
-
We've had a few reports of issues with the Screenshot "Plugin of the Month". They fall into two main categories: Attempting to NETLOAD the application DLL from a network share Within the ReadMe for each of the plugins we've documented that each application's DLL module should be copied to the local file system – preferably inside the AutoCAD Program Files folder – before being loaded by NETLOAD. We recommend this because it essentially stops users from hitting a whole category of .NET Framework-related problems when loading and running the plugins. If you didn't heed this advice then you'd probably find…
-
Some of you may remember a philosophical question I raised in a post some time ago. The overall consensus of the feedback we received was to prioritise delivering code samples (given a choice between code samples and wizard-like code-generation tools). Which we are doing, both via the ADN site and our developer blogs… but that doesn't mean some investment in code-generation tools isn't also appropriate, from time-to-time. 🙂 Cyrille Fauvel, who manages the Media & Entertainment arm of DevTech but also occasionally works on technical activities that relate to our other products, has put together a new (currently draft) version…
-
While I was preparing this recent post I put together a simple project which registered localized names for commands, to make sure they were picked up and used to create the appropriate demand-loading Registry keys. It was a little tricky to do this from the current documentation, so thankfully I had access to this DevNote on the ADN site which helped a great deal (this is only available to ADN members but don't worry if you're not one: this post should provide equivalent information and in certain ways goes beyond the original example). Anyway, it seemed a relevant topic to…
-
Here's a question I received recently by email: How do you set up a .NET plugin for AutoCAD to install & demand load in the same way as ObjectARX plugins? The documentation is not very clear at making the distinctions visible. In ARX terms, we currently write a set of registry entries as part of our installer, along with refreshing these via an AcadAppInfo registration during ARX load. The ARX itself can be located anywhere as long as the registry entries point to it. I'm not sure of the correct procedure for .NET plugins to duplicate this. Augusto Gonçalves, from…
-
Thanks to all of your interest in this recent post, which looked at a way to interface an out-of-process .NET application with an assembly running in-process to AutoCAD. After some obvious functionality gaps were raised, Renze de Waal, one of our ADN members, pointed out a DevNote on the ADN website covering – and more completely addressing – this topic. Shame on me for not checking there before writing the post. Anyway, onwards and upwards… The information in the DevNote highlights some of the problems I and other people had hit with my previous code, mostly related to the fact…
-
This question came in recently by email from Michael Fichter of Superstructures Engineers and Architects: Could you suggest an approach that would enable me to drive a .NET function (via COM) that could return a value from .NET back to COM? I have used SendCommand in certain instances where return values were not needed. Michael's referring to a technique used in this previous post, which shows how to launch AutoCAD from a .NET executable via COM and then launch a command which can then safely interface with AutoCAD in-process via its managed API. And yes, this technique is fine if…
-
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 with Maya and MotionBuilder – are fierce proponents of the language. I'm told that it's an extremely easy, general-purpose, dynamic programming language. All of which sounds interesting, of course, although I have to admit I'm less convinced of the importance of the dynamic piece: I've…
-
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,…
-
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 { …