|
POST
|
Are you certain that the error is occurring on that line of code? The error says it is unable to cast the object to ILayer2. Nowhere in the code you posted are you attempting a cast to ILayer2 (only ILayer) so I don't see any way for that exception to be thrown.
... View more
12-05-2013
05:27 AM
|
0
|
0
|
525
|
|
POST
|
Neil, Yes it is a service, however for testing we are running it as a tool inside ArcMap. Since I am running inside the context of ArcMap can I still get a way to gain access to IApplication? Yes, if you are creating the tool using COM then the hook parameter passed into ICommand.OnCreate is of type IApplication, you just need to cast it and keep up with it. If you're creating an add-in then there is a global object available that will give you the reference. I don't use add-ins so I can't tell you what it's called but I'm sure it's in the documentation.
... View more
12-04-2013
09:58 AM
|
0
|
0
|
925
|
|
POST
|
How are you running this code? Your post says you are testing the component inside of ArcMap, so whatever mechanism you're using to run that code should have access to the application. For instance, if you've created a command then it is given a reference to the application in its OnCreate method.
... View more
12-04-2013
04:17 AM
|
0
|
0
|
925
|
|
POST
|
An Engine application does not have a document for you to reference nor can you use the tools that belong to ArcMap in an Engine application. Engine ships with it's own set of built-in tools for you to use. If you need something more than that then you must write your own tool.
... View more
12-02-2013
06:54 AM
|
0
|
0
|
386
|
|
POST
|
You can created the graph by using the IDataGraphT interface. For each graph, get the surface from the elevation layer (ISurface) and use it to interpolate the z values for the polyline (you must make the polyline z-aware). You can then create a data series on the graph using the z-values from the line. If you like, you can plot all of the data series on the same graph.
... View more
11-14-2013
04:27 AM
|
0
|
0
|
790
|
|
POST
|
Looks to me like you have code inside your class definition that is not inside a property or function definition.
... View more
11-12-2013
04:17 AM
|
0
|
0
|
1131
|
|
POST
|
You should not be using the New keyword to create instances of singleton objects such as workspaces. Use the Activator class instead. http://resources.arcgis.com/en/help/arcobjects-net/conceptualhelp/#/Interacting_with_singleton_objects/00010000043p000000/
... View more
11-12-2013
04:15 AM
|
0
|
0
|
696
|
|
POST
|
You should reread Melita's last post. Your screenshots clearly indicate you are looking at the geodesic distance.
... View more
11-07-2013
04:18 AM
|
0
|
0
|
1831
|
|
POST
|
Unless you're using an ORDER BY clause in the query or doing something else to sort the results, the features in a feature cursor will not be in any reliable order. For example, if the ObjectId of the current feature is 2 you can't assume that the ObjectId of the previous feature was 1. This may or may not apply to your specific scenario but I just wanted to point it out in case it does matter.
... View more
11-06-2013
11:54 AM
|
0
|
0
|
769
|
|
POST
|
Any time you call PartialRefresh you must call it twice. You must call it once before you do whatever will need refreshing and you must call it once after you do it.
... View more
11-04-2013
04:07 AM
|
0
|
0
|
489
|
|
POST
|
Have you included all of the required ESRI assembly references in your project? For a text element they are Carto, Geometry and System. Also, if your project references the .NET Framework 4.0 be sure you set the Imbed Interop Types property to False for all of your ESRI assembly references.
... View more
10-31-2013
11:34 AM
|
0
|
0
|
310
|
|
POST
|
If you need for the user to interact with the map then you should be creating a tool, not a command. The implementation of a tool includes mouse down, mouse up and mouse move events.
... View more
10-31-2013
11:26 AM
|
0
|
0
|
525
|
|
POST
|
I notice that you aren't giving your graphic element a spatial reference. Without a spatial reference defined, it's quite possible that ArcMap will not properly project the element. Have you determined that this is not a spatial reference issue? I've been using ITopoOp.Buffer for over a decade and have never had any problems with it.
... View more
10-31-2013
05:23 AM
|
0
|
0
|
1831
|
|
POST
|
Have you tried using the actual tool in ArcToolbox to do this and looked at the parameters it displays when it runs? If not, that's probably the best place to start.
... View more
10-30-2013
11:51 AM
|
0
|
0
|
507
|
|
POST
|
No, your code is incorrect: (pLayer as IGeoDataset).SpatialReference; You are performing a QI from ILayer to IGeoDataset. Calling the SpatialReference property here returns the spatial reference of the layer because that's what object you're working with. In order to get the spatial reference of the data source, you need to access the data source (not the layer): IFeatureLayer featureLayer = yourLayer; IGeoDataset geoDataset = featureLayer.FeatureClass as IGeoDataset;
... View more
10-30-2013
06:55 AM
|
0
|
0
|
644
|
| Title | Kudos | Posted |
|---|---|---|
| 1 | 06-20-2014 05:29 AM | |
| 1 | 02-01-2011 04:18 AM | |
| 1 | 02-04-2011 04:15 AM | |
| 1 | 01-17-2014 03:57 AM | |
| 1 | 10-07-2010 07:37 AM |
| Online Status |
Offline
|
| Date Last Visited |
11-11-2020
02:23 AM
|