Jun 16 2009

IronPython (2.6) and ArcGIS - ready for prime time!!

Published by perrygeo at 2:43 pm under ESRI, Python

Not sure why this didn’t occur to me before I wrote that last post but I tried the “pythonic” version of the code under the IronPython 2.6 Beta 1 release and it works!

lyr = Carto.LayerFileClass()
lyr.Open('C:\\test.lyr')
print lyr.Filename

Works perfectly now. So IronPython 2.6 promises to be a viable option for extending ArcGIS. My enthusiasm has been renewed.

4 Responses to “IronPython (2.6) and ArcGIS - ready for prime time!!”

  1. […] surprised that IronPython doesn’t get more love in the ESRI development world.  Beyond Matthew’s blog posts I can’t recall seeing anything really being done.  Considering how important .NET is to […]

  2. Ed Knuthon 18 Jun 2009 at 9:29 am

    Welcome back, Mr. Perry. It’s nice to see you posting again.

    IronPython rules, if you have to do the .net thing.

  3. Crischanon 02 Jul 2009 at 3:33 am

    Hi,

    I just got IronPython to work with my Aptana PyDev installation. When running your code, I get a licence to check out but then the error:

    AttributeError: ‘GenericComObject’ object has no attribute ‘Open’

    Also I don’t see the difference between the not-ready-for-prime-time and ready-for-prime-time code snippets… am I blind?

    Cheers,
    Crischan

  4. perrygeoon 02 Jul 2009 at 7:13 am

    Crischan -

    See the previous post - http://www.perrygeo.net/wordpress/?p=135.

    There is NO difference between the code - the only difference is that you need IronPython 2.6 to run it which solves many annoying problems with accessing COM objects.

Trackback URI | Comments RSS

Leave a Reply