|
POST
|
Are you checking out a license? If not, then your code won't run. Also, if you're using ArcGIS 10 then you will also have to bind to a product before checking out the license.
... View more
03-06-2012
11:17 AM
|
0
|
0
|
896
|
|
POST
|
The IWorkspace interface has a DatasetNames property that you can use to get the feature classes. The IFeatureClass interface has a Fields property that you can use to get the fields.
... View more
03-06-2012
04:27 AM
|
0
|
0
|
2772
|
|
POST
|
A feature layer doesn't have a geometry. A feature layer contains features, each of which have a geometry. You can get the features from a feature layer via a query. The query can be an attribute query or a spatial query. Here is one example. Dim featureCursor As IFeatureCursor = featureLayer.FeatureClass.Search(Nothing, False) Dim feature As IFeature = featureCursor.NextFeature Do While feature IsNot Nothing Dim geometry As IGeometry = feature.ShapeCopy feature = featureCursor.NextFeature Loop
... View more
03-01-2012
11:40 AM
|
0
|
0
|
1181
|
|
POST
|
I suspect that one of the things that is happening is that you're running into problems caused by objects being returned by value vs. by reference. When you do something like this, you open your code up to this type of problem: pCartoLineSymbol.Color = pFillSymbol.Outline.Color The Outline property can return the line symbol object by value or by reference. The behavior can be different between the two. You can tell one vs. the other by looking at the developer help but in short, the best way to keep from running into problems is to simply not chain property calls. Instead of the code above, do this: Dim outline As ILineSymbol = pFillSymbol.Outline pCartoLineSymbol.Color = outline.Color Try changing you code so that you aren't chaining any property calls and see if it behaves any differently.
... View more
02-28-2012
04:26 AM
|
0
|
0
|
1562
|
|
POST
|
Those are the dlls you need. All of the ArcObjects classes are in the ESRI.ArcGIS namespace. If you're looking at something that refers to the ESRI.ArcObjects namespace then that's probably about 10 years or so out of date. Here's a link to the current ArcGIS 10 Developer Help: http://help.arcgis.com/en/sdk/10.0/arcobjects_net/ao_home.html The API reference is a tab at the top of the page. It also includes several other help topics that you may find useful.
... View more
02-22-2012
03:25 PM
|
0
|
0
|
1088
|
|
POST
|
What version of Visual Studio are you using? If you are using a version that is not supported by the ESRI SDK then you will have to add the references manually by browsing to the assembly files. These files are in the DotNet folder under the folder where you installed ArcGIS Desktop. Also, make sure your project in Visual Studio is set to target the correct version of the .NET Framework (which for ArcGIS 10 should be .NET 3.5). If you are targeting the .NET 4.0 Framework then I don't think the assemblies show up in the References dialog on the .NET tab.
... View more
02-22-2012
08:48 AM
|
0
|
0
|
1088
|
|
POST
|
Add-ins can be commands or tools so you just need to create an add-in of the correct type (tool) to use from the button on your form. I'm not sure how you get references to add-ins through code (I don't work regularly with ArcGIS 10) so using an add-in for the tool may not be the best or easiest choice. You can always create commands and tools by implementing the ICommand and ITool interfaces. If you do this then you will need to register these classes during deployment whereas you wouldn't if you create add-ins. That may or may not be a concern for you but just wanted to mention it.
... View more
02-21-2012
04:19 AM
|
0
|
0
|
1053
|
|
POST
|
Create a tool that allows the user to click the map. In the button click event on your form, get a reference to this tool from IDocument::CommandBars and set it to be the current tool. When implementing your tool, create a custom event called OnPointClicked or something like that. Create a custom event arguments class that contains an IPoint reference as one of its properties. Your custom event should use this custom arguments class for its arguments. In the custom tool's MouseDown event, create a new instance of the custom arguments class, set the point property to be the point clicked and raise the event. In the button click event on your form, register for this event before setting the custom tool to be the current tool. Wire the event to a method on your form that will do whatever you need to do with the point.
... View more
02-20-2012
04:04 AM
|
0
|
0
|
1053
|
|
POST
|
If a layer has a broken data link then ILayer::Valid returns False.
... View more
02-17-2012
05:23 AM
|
0
|
0
|
544
|
|
POST
|
In .NET you should not use New to create instances of singleton objects. Use the Activator class as explained here: http://help.arcgis.com/en/sdk/10.0/arcobjects_net/conceptualhelp/index.html#/Interacting_with_singleton_objects/00010000043p000000/
... View more
02-16-2012
04:39 AM
|
0
|
0
|
2628
|
|
POST
|
The geometry type for a line feature class is esriGeometryPolyline. You're using the correct geometry type when creating the geometry definition but your tests on whether to create the fields or not are using esriGeometryLine. This is causing the code to create all of the fields. Also, a better way to add new fields is to create the field object then call IFieldsEdit::AddField. You don't set the FieldCount property when you do this because AddField will increment it for you automatically.
... View more
02-10-2012
04:28 AM
|
0
|
0
|
813
|
|
POST
|
From the developer help topic for IMap::FeatureSelection: Note, only the shape field is guaranteed with the selection. This is the default and exists for performance reasons. The IMap::FeatureSelection property is typically used to draw the map selection, not access feature attributes. This is particularly noticeable with shapefiles and coverage but also in geodatabases if the selection is large enough. Use IEnumFeatureSetup::AllFields to set a flag indicating all fields be returned with the selection. If you want to loop through the map selection to perform an operation, it is typically best to access each layer's selection rather than the entire map's selection. See the example for a sample of each.
... View more
02-10-2012
04:20 AM
|
0
|
0
|
618
|
|
POST
|
You're confusing the id of a feature class with the id of a feature. They aren't the same thing. The id of a feature class uniquely identifies the feature class within the geodatabase. This is why shapefiles and CAD files have a feature class id of -1 (which isn't a valid value for a geodatabase feature class id); they don't belong to a geodatabase. These ids are used mainly by the geodatabase itself; you will rarely, if ever, need to use the id of a feature class for anything. The id of a feature uniquely identifies that feature within a feature class. For geodatabase feature classes, the feature id field is named ObjectId by default. For shapefiles it is usually named FID. You can see the feature ids by adding the feature class as a layer to ArcMap and opening the attribute table. It is this feature id that you will need to pass into GetFeature to return a particular feature from the feature class. You can then pass the feature into the SymbolByFeature method to get the symbol that is used to draw the feature in the map view.
... View more
02-08-2012
10:07 AM
|
0
|
0
|
1145
|
| 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
|