Scripting Applications with IronPython (ADAM, Revit, AutoCAD & Postsharp)
IronPython and the Dynamic Language Runtime make it almost ridiculously easy to add scripting to .NET applications. In recent weeks several examples of using IronPython to add scripting or interactive shells to .NET applications have been posted by the .NET community: Command-line scripting of IronPython code in AutoCAD This post was heavily inspired by the code presented by my old friend Albert Szilvasy during his excellent AU class on using .NET 4.0 with AutoCAD . ... In this post we’ll take Albert’s technique and implement a command-line interface for querying and executing IronPython script. This approach could also be adapted to work with other DLR languages such as IronRuby, of course. Here’s the updated C# code which now not only implements PYLOAD functionality, but also a PYEXEC command. Scriptability via the DLR and PostSharp Making an application scriptable (particularly in a static language) has historically been difficult. With the advent of the DLR (D...