|
POST
|
Your code is not running inside of ArcMap. Therefore, any ArcObjects you create using the NEW keyword are created outside of ArcMap's process space. ArcObjects are single apartment threaded, meaning they will not marshal correctly across process boundaries. In order to work correctly, you will need to create all instances of the ArcObjects you're using inside of ArcMap's process space. This can be done by using IObjectFactory.
... View more
09-29-2011
02:16 PM
|
0
|
0
|
1886
|
|
POST
|
If you don't have an Imports statement at the top of the code module for the correct library you'll have to fully qualify it just like you've done here: Dim srFact As ESRI.ArcGIS.Geometry.ISpatialReferenceFactory = obj
... View more
09-29-2011
06:59 AM
|
0
|
0
|
804
|
|
POST
|
You get the layer you want, QI to IFeatureSelection and call the Clear method. That's pretty much it.
... View more
09-22-2011
06:04 AM
|
0
|
0
|
1685
|
|
POST
|
You can't rename a field using ArcObjects. You can, however, create a new field (and copy existing values to it) then delete the old field. Depending on the datasource you may have other options - for instance, if it's a personal geodatabase you can open it in Access and rename the field.
... View more
09-19-2011
05:29 AM
|
0
|
0
|
917
|
|
POST
|
I would just look at the field type and format the query accordingly. I haven't tested this but it would look something like this: Public Function GenerateQueryString(ByVal featureClass As IFeatureClass, ByVal fieldName As String, ByVal value As Object) As String
Dim field As IField = featureClass.Fields.Field(featureClass.Fields.FindField(fieldName))
Dim delimiter As String = String.Empty
If field.Type = esriFieldType.esriFieldTypeString Then delimiter = "'"
Dim queryString As String = String.Format("{0} = {1}{2}{1}", fieldName, delimiter, value)
Return queryString
End Function
... View more
09-09-2011
01:07 PM
|
0
|
0
|
515
|
|
POST
|
It's been awhile since I've worked with the graphing objects but from what I remember there are properties exposed in the ArcMap UI that are not exposed through the ArcObjects model. This may be one of them. You might want to look into creating a graph template file which you can load when creating the graph. After loading the template you can then change any properties that need to be updated for your current graph.
... View more
09-09-2011
06:55 AM
|
0
|
0
|
510
|
|
POST
|
The thing to keep in mind is that the ObjectIds are not necessarily in sequential order. If features have been deleted, then there will be gaps in the ids. So, you can't simply +1 the OID to query for the next feature. I would suggest keeping an array of OIDs instead of trying to query for the next feature. The first time the button is clicked, it will initialize the array by querying for all features in the layer and adding their OIDs to the array. Use IQueryFilterDefinition to specify an ORDER BY clause to sort on the OID field (or you can just sort the array after you've added all of the OIDs). The first time through you will query for and select the feature whose OID is at index 0 in the array. After that, you get the OID of the selected feature, find the index position in the array that contains that OID and then get the OID at the next index position. Also, use IFeatureClass.GetFeature instead of using a query filter to select the individual features. It's faster.
... View more
09-07-2011
05:31 AM
|
0
|
0
|
3896
|
|
POST
|
If the feature class is z-aware then the feature geometry must have z values. You can do this several ways. One way is to use a functional surface and use it to interpolate z values for the geometry. You can also assign a z value of 0 (or another constant value) to each vertex point. To do this, you just QI over to IZAware and set the ZAware property to True. You then QI to IZ and call the SetConstantZ method. You can also use one of the other IZ methods to set z values for the geometry if you like. Also, the exact opposite is true. If the feature class is NOT z-aware then the feature geometry cannot have z values. In this case, you simply QI to IZAware, set ZAware to False and call the DropZs method.
... View more
09-06-2011
10:57 AM
|
0
|
0
|
1104
|
|
POST
|
The workspace for a shapefile is the directory that contains the files that make up the shapefile. The problem with the code that you posted is that you're passing in the path to the *.shp file, which is incorrect. The workspace for a file geodatabase is also a directory. The workspace for a personal geodatabase is the database file. So, make sure you're passing in the correct path for the type of workspace you're trying to open. A recent thread also suggested that there is a bug when binding using the EngineOrDesktop option. If you have Engine installed but not licensed then the binding will fail even if you have Desktop installed and properly licensed.
... View more
09-06-2011
05:10 AM
|
0
|
0
|
2025
|
|
POST
|
Well, I don't think it's a bug because the only way the filter would change like that is if someone at ESRI went in and changed the code to recognize a file geodatabase. Why they did it is beyond me, especially since they added a filter for file geodatabases. It's quite an annoying change to say the least. I handled it by writing my own custom Gx Filter for PGDBs.
... View more
09-02-2011
01:45 PM
|
0
|
0
|
540
|
|
POST
|
The path is stored as a user-specific setting. Visual Studio stores this setting in the *.suo file that sits alongside the solution (*.sln) file in your solution directory. If you're using source control, then this file shouldn't be included when you add the solution to your source control provider. If you're simply copying the solution down from a server or something, you shouldn't copy this file. Each developer should have their own *.suo file on their development machine.
... View more
09-02-2011
05:25 AM
|
0
|
0
|
907
|
|
POST
|
You're confusing two different things. The first thing you posted is the declaration of the delegate to be used when wiring the event. The second thing is the interface definition. IActiveViewEvents is an "outgoing" interface (also called an event interface). In COM programming, events are defined as methods on an event interface. Classes that need to expose these events do so by implementing the event interface. Here's an article that might help you: http://www.codeproject.com/KB/COM/TEventHandler.aspx
... View more
09-01-2011
06:01 AM
|
0
|
0
|
903
|
|
POST
|
I'm not sure where you're seeing an error. You've posted the delegate declaration as well as the interface declaration. Those are two different things. If you need information on how to wire ArcObjects events in .NET then refer to this help page: http://help.arcgis.com/en/sdk/10.0/arcobjects_net/conceptualhelp/index.html#/How_to_wire_ArcObjects_NET_events/0001000002p3000000/
... View more
09-01-2011
05:22 AM
|
0
|
0
|
903
|
| 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
|