|
POST
|
The problem is most likely the query filter you're passing into the Update method. Make sure the SQL syntax is correct, that everything is spelled correctly and that any fields you're naming exist in the feature class.
... View more
03-12-2012
05:51 AM
|
0
|
0
|
2684
|
|
POST
|
You can do that if you want but I've run into problems trying to use the 4.0 Framework with ArcObjects. The majority of our code is still at 9.3.1 but if you're using 10.0 you may not run into the same problems.
... View more
03-12-2012
05:47 AM
|
0
|
0
|
2131
|
|
POST
|
Yes, it's possible. The basic process would be to get the functional surface (ISurface) from your elevation layer, get/create a polyline (IPolyline) object that the profile should be based on, interpolate z-values for the polyline (ISurface.InterpolateShape) or call ISurface.GetProfile and then graph it. You can use the built-in graph objects (IDataGraphT) or use a 3rd party graphing library to display the profile graph.
... View more
03-12-2012
05:44 AM
|
0
|
0
|
2432
|
|
POST
|
The .NET Framework 4.0 is not currently supported. You'll have to change the target framework back to 3.5.
... View more
03-12-2012
05:38 AM
|
0
|
0
|
2131
|
|
POST
|
Anytime you use an ArcObjects cursor (ICursor or IFeatureCursor), you need to release the reference as soon as you're done with it by calling Marshal.FinalReleaseComObject. The same is true for any IFeature/IRow objects you're using. If you're using IFeature/IRow objects within a loop, then call FinalReleaseComObject on them before setting the feature/row variable to the next object in the cursor. You can also use ESRI's ComReleaser class. Doing this should release any locks on the database.
... View more
03-12-2012
05:36 AM
|
0
|
0
|
886
|
|
POST
|
Here's part of the documentation: http://help.arcgis.com/en/sdk/10.0/arcobjects_net/conceptualhelp/index.html#/Releasing_COM_references/0001000004tm000000/ And here's the documentation for the ManageLifetime method: http://help.arcgis.com/en/sdk/10.0/arcobjects_net/componenthelp/index.html#/ManageLifetime_Method/00050000000n000000/ As you can see, it says objects are released during the Dispose process, which I take to mean when they go out of scope or when the ComReleaser itself goes out of scope (i.e. exiting a Using block). It also states that ReleaseComObject is called until the reference count is 0, which is the same as calling FinalReleaseComObject. Again, I'm not advising anyone not to use the ComReleaser class, I'm just saying that releasing the objects yourself is one sure-fire way of knowing exactly what your code is doing. Also, the only time I've ever found I needed to explicitly release anything is when dealing with cursors and feature/row objects. For everything else I just them go out of scope and be at the mercy of the garbage collector.
... View more
03-08-2012
12:11 PM
|
0
|
0
|
1137
|
|
POST
|
Neil, why do you suggest not using ComReleaser? I don't think that the ComReleaser is any help when using objects within loops. When looping through a cursor, the feature or row object needs to be released before assigning it to the next feature or row in the cursor. According to the documentation, the ComReleaser doesn't actually clean anything up until the object reference goes out of scope. These objects within the loop are not out of scope so I don't think any cleanup occurs as the loop iterates. It's only after the loop that the cleanup occurs so the loop has resulted in possibly thousands or millions of objects waiting to be released. Releasing these objects yourself within the loop allows any garbage collection that occurs while the loop is running to reclaim those objects. Also, all the ComReleaser does is perform the equivalent of calling FinalReleaseComObject. So, in reality, it's just more overhead for something you can easily do yourself. It can also be dangerous. For instance, if you get a feature layer reference from the map you don't want to call FinalReleaseComObject on it because that will release the map's reference to it in addition to releasing your own variable's reference. If I understand the documentation correctly, the ComReleaser would do just that. What you actually want to do is call ReleaseComObject vs. FinalReleaseComObject. Calling these methods yourself should make you think about what you are doing and decide which of the methods is the correct one to call. This, of course, is just my opinion. I'm not advising against using the ComReleaser class, just saying it isn't really needed.
... View more
03-08-2012
11:06 AM
|
0
|
0
|
2428
|
|
POST
|
As I mentioned before, you can use IWorkspace::DatasetNames to get the feature classes from a workspace. If your feature classes are inside feature datasets then use this method to get the feature datasets then loop through each dataset to get the feature classes.
... View more
03-08-2012
04:48 AM
|
0
|
0
|
2772
|
|
POST
|
You have to call IRowSubtypes::InitDefaultValues in order to set default values on the new row. There is an example in the developer help topic for this method.
... View more
03-08-2012
04:41 AM
|
0
|
0
|
646
|
|
POST
|
At ArcGIS 10 you have to bind to a product before attempting to check out a license. At the top of this page is a Help link. Follow that to the SDK help and there is a help topic on migrating your code to ArcGIS 10 that should help you.
... View more
03-08-2012
04:37 AM
|
0
|
0
|
1025
|
|
POST
|
I would get rid of using the ComReleaser altogether. Here is the proper way to get a cursor and loop through it as well as clean up the objects that it uses: Dim featureCursor As IFeatureCursor = featureClass.Search(queryFilter, False)
Dim feature As IFeature = featureCursor.NextFeature
Do While feature IsNot Nothing
' do something with the feature
FinalReleaseComObject(feature) ' release the feature before setting it to the next feature in the cursor
feature = featureCursor.NextFeature
Loop
FinalReleaseComObject(featureCursor) ' release the cursor Look through your code and make sure you're releasing every cursor as soon as you're done with it and that you're releasing all feature references as soon as you're done with them (including those used in loops as shown above). This is most likely where you're getting your error from. One of your functions returns an IFeature reference. I would change this to return the feature's geometry because that's what you're actually needing from the feature. Post your updated code if you're still having problems.
... View more
03-08-2012
04:34 AM
|
0
|
0
|
3774
|
|
POST
|
Could you edit this to use the CODE tags (the # button on the toolbar in the editing window) so that the code you posted is formatted correctly?
... View more
03-07-2012
11:58 AM
|
0
|
0
|
3774
|
|
POST
|
Still need help. This is the exception that I got when I changed it over from user handled: System.Runtime.InteropServices.COMException {"The operation was attempted on an empty geometry."} The error is telling you the geometry is empty, which means it does not contain valid points. In the case of a line, it most likely means the from and to points have the same coordinates (which does not define a valid line). Check your points to make sure the coordinates are being set correctly. Also, if FromPoint and ToPoint are accurately named then you're passing them in backwards to the PutCoords() method.
... View more
03-07-2012
06:41 AM
|
0
|
0
|
3014
|
|
POST
|
You can select a layer by setting IContentsView::SelectedItem. You can get the contents view reference from IMxDocument::CurrentContentsView.
... View more
03-07-2012
04:21 AM
|
0
|
0
|
1579
|
| 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
|