POST
|
Have you tried each of CA's State Plane projections?
... View more
03-10-2016
09:40 AM
|
0
|
1
|
446
|
POST
|
I noticed that your original fields are integer. In that case it would be (using the newer syntax): print "{0}-{1}".format(str(!ACONTROL!).zfill(4), str(!ASECTION!).zfill(2))
... View more
10-27-2014
01:44 PM
|
0
|
1
|
560
|
POST
|
I think zfill would be a little more flexible: print "%s-%s" % (!ACONTROL!.zfill(4), !ASECTION!.zfill(2)) That will automatically pad the input with the correct number of zeros.
... View more
10-27-2014
08:14 AM
|
0
|
22
|
992
|
POST
|
I have a Modelbuilder tool that calls a Python script. I have selected the option in Modelbuilder Properties to use relative paths. If I move the folder that both the toolbox and script are in to another location (or give it to another user), the tool can no longer find the script; it expects it to be in the original folder. Any ideas on how to make this project truly portable?
... View more
10-23-2014
04:59 PM
|
1
|
3
|
2012
|
POST
|
What that probably means is that the list was empty; no GRIDs in the folder. You may need to make it a little smarter:
rasterInDir = arcpy.ListRasters("*", "GRID")
if len(rasterInDir) > 0:
rasterList.append([os.path.join(arcpy.env.workspace, A) for A in rasterInDir])
... View more
07-11-2014
09:25 AM
|
1
|
4
|
474
|
POST
|
You could use a list comprehension on line 8 to create a full path to each of the rasters:
rasterList.append([os.path.join(arcpy.env.workspace, A) for A in arcpy.ListRasters("*", "GRID")])
... View more
07-10-2014
02:54 PM
|
1
|
7
|
474
|
POST
|
Back to the original question... Addins are ArcGIS-version specific. A 10.2 compiled Addin won't work with 10.1, even if the underlying ArcObjects code is 10.1 compatible. It's also true vice-versa. If you have clients running 10.1 you may need to keep an installation with ArcGIS 10.1 & Visual Studio 2008 or 2010 in order to develop new solutions for them.
... View more
01-22-2014
11:35 AM
|
1
|
0
|
984
|
POST
|
I'm using Visual Studio 2010, .NET 3.5 with ArcGIS 10.0.
... View more
12-19-2013
10:26 AM
|
0
|
0
|
332
|
POST
|
I have an Addin button (called Analyze) that processes some data, then calls a modeless form. I want the button to be disabled until the user closes the form, or else it will be possible for the user to accidentially have multiple instances of the form open at the same time. To disable the button I use Me.Enabled = False in the button's OnClick event. What I can't figure out is how to reference the button from within the form. I was planning on changing the button's Enabled attribute back to True in the form's FormClosing event, unless someone knows of a better way. Any Ideas?
... View more
12-19-2013
07:57 AM
|
0
|
5
|
710
|
POST
|
I have a Map Service layer from ArcGIS Server that I can query using the Identify tool:[ATTACH=CONFIG]29589[/ATTACH] I'm writing some test code to try to achieve the same thing via ArcObjects:
Dim pMxDoc As IMxDocument = My.ArcMap.Document
Dim pLayer As ILayer = pMxDoc.FocusMap.Layer(0) 'Map Service layer
Dim pnt As New Point
pnt.SpatialReference = pMxDoc.FocusMap.SpatialReference 'same as layer 0
pnt.PutCoords(-11171129, 5523036)
Dim pArray As IArray = CType(pLayer, IIdentify2).Identify(pnt, Nothing)
Dim pFIO As IFeatureIdentifyObj
For i = 0 To pArray.Count - 1
pFIO = pArray.Element(i) 'Error occurs here
Next The resulting pArray has 2 objects, which corresponds with the 2 layers in the Map Service layer. But when I cast to the IFeatureIdentifyObj (as suggested in the API Reference), it throws this error: A first chance exception of type 'System.InvalidCastException' occurred in GISserver.dll System.InvalidCastException: Unable to cast COM object of type 'System.__ComObject' to interface type 'ESRI.ArcGIS.Carto.IFeatureIdentifyObj'. This operation failed because the QueryInterface call on the COM component for the interface with IID '{4E08D830-D361-11D2-8CD0-00C04F5B951E}' failed due to the following error: No such interface supported (Exception from HRESULT: 0x80004002 (E_NOINTERFACE)). at GISserver.Button1.OnClick() in C:\Users\documents\visual studio 2010\Projects\GISserver\GISserver\Button1.vb:line 27 Can someone tell me what is missing?
... View more
12-04-2013
12:44 PM
|
0
|
0
|
323
|
POST
|
A couple of hints: You no longer need to use the 'Set' keyword You can combine the 'Dim' and 'Set' statements on one line Dim pFClass As IFeatureClass
Set pFClass = pFeatLayer.FeatureClass can now be expressed as Dim pFClass As IFeatureClass = pFeatLayer.FeatureClass Use a Try statement to trap errors. You can see the errors with ex.ToString
... View more
11-25-2013
06:32 AM
|
0
|
0
|
434
|
POST
|
I'm reviving this thread because I was bit by the same issue again today. After a Google search (why didn't I think of that last time?), I found a solution by Ken Buja from 2008 in the archived forums (http://forums.esri.com/Thread.asp?c=93&f=1170&t=248305). So Ken, if you reply to this thread I'll give you credit for the solution. Thanks for answering my 2 month old question 5 years ago.
... View more
10-29-2013
09:03 AM
|
0
|
0
|
211
|
POST
|
Bruce, Not come across that error before but as I interpret it, it is saying that pHELLayer exists already. Have you opened it in the other module you refer to? May be using the ReleaseInternals method on IGPUtilities may help? Duncan No, I hadn't used that variable in any other place. I was actually using the OpenFeatureLayerFromString method directly as a parameter in a function, and got the same error. I took it out and assigned it to pHELLayer in order to isolate what was causing the error. I will try ReleaseInternals to see if that helps. Thanks.
... View more
09-06-2013
07:26 AM
|
0
|
0
|
211
|
Title | Kudos | Posted |
---|---|---|
1 | 08-16-2012 01:21 PM | |
1 | 07-29-2011 07:46 AM | |
1 | 01-03-2012 07:42 AM | |
1 | 01-22-2014 11:35 AM | |
2 | 05-21-2012 04:24 AM |
Online Status |
Offline
|
Date Last Visited |
04-07-2023
09:52 PM
|