POST
|
Thanks for that Ken, I spent all morning trying to figure out how to get what you suggested to work how I wanted it to, but I've finally managed to do it. I had to put it in a new module and reference that from another module with the inputs, so it works on my shapefile in one go (rather than looping through all the points in the shapefile and using the calculator on each point). The only things I had to alter was to comment out both references to Message as it was giving me funny errors which I couldn't shift. I also changed Globals.GP.MessageCount to just GP.MessageCount as it didn't like the Globals part. Great help and valuable tip for future work. Nathan.
... View more
04-30-2012
06:12 AM
|
0
|
0
|
658
|
POST
|
Looks like a good possibility. I'm away from the office for the weekend now, but will try the code next week and hopefully post back some good news. Thanks.
... View more
04-27-2012
11:52 AM
|
0
|
0
|
658
|
POST
|
My company is going through the process of upgrading our software to ArcGIS 10.0 from 9.3.1, half the machines are now at 10.0 and half are still on 9.3.1. I'm in the process of upgrading all our VBA code to VB.NET and add-ins. My current problem is with calling the Field Calculator programmatically. With 9.3.1 I was able to use ArcObjects in the pre-expression to define a shape and extract the X or Y co-ordinates. I know that with 10.0 the VBA has been retired and I now have the choice of VB Script or Python. If I have the attribute table open and directly use the Field Calculator, the Python line !shape.extent.XMax! does exactly what I want. Is there any way I can get this to work in the VB.NET code that I am using with the add-in. I can call the calculator but I think I've seen that it's a known bug that you can't define what parser will be used in the calculator, thus defaulting to VB Script (which I don't think will extract/identify the X/Y co-ordinate - but correct me if I'm wrong). Any help with this would be greatly appreciated.
... View more
04-27-2012
11:05 AM
|
0
|
5
|
3398
|
Online Status |
Offline
|
Date Last Visited |
11-11-2020
02:23 AM
|