Python

  • To continue my investigations into IronPython and the fun I'm having with overrules, I decided to to port my most recent C# overrule implementation across to IronPython. I've also been trying to do the same for IronRuby, but – so far – without luck. Please refer back to one of the previous IronPython posts for the PYLOAD command implementation needed to load our Python script into AutoCAD. Here are the contents of our .py file: import clr path = 'C:\\Program Files\\Autodesk\\AutoCAD 2010\\' clr.AddReferenceToFileAndPath(path + 'acdbmgd.dll') clr.AddReferenceToFileAndPath(path + 'acmgd.dll')   import Autodesk import Autodesk.AutoCAD.Runtime as ar import Autodesk.AutoCAD.ApplicationServices as aas import…

  • After getting my feet wet in the last post with my first IronPython application running inside AutoCAD, I decided it was time to attack a slightly more challenging problem: jigging a database-resident Solid3d object. The idea had come after I'd received a question by email from David Wolfe, who wanted to have a fully rendered 3D view of a cylinder he was jigging. I'd done something similar for a prototype application I worked on late last year (which was demoed at AU). The jig itself only collected the selection data I needed – the display of the Solid3d objects was…

  • 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…