|
POST
|
Yes, I just tried it on a table that had both a table join and a relate and it worked fine. It shouldn't matter though because the ITable reference returned by IStandAloneTable.Table is a reference to the actual table in the geodatabase, which will not be aware of any joins or relates. If you want, you can attach the geodatabase you're using and I'll try to run my code against your data.
... View more
03-08-2011
08:51 AM
|
0
|
0
|
1279
|
|
POST
|
I'm still not sure where the tolerance comes from In ArcMap, choose Options from the Selection menu. The tolerance is displayed on this dialog and is an editable value for the user. If you're creating very small buffers you may be running into the limits of the coordinate system's resolution. You may want to use IBufferConstruction instead of ITopologicalOperator to create your buffer. You will also want to set the spatial reference on the buffer polygon so that it has the same coordinate system as the layer you're querying.
... View more
03-08-2011
04:51 AM
|
0
|
0
|
443
|
|
POST
|
Access does have a limit of 64 characters for field names (and shapefiles are 10 chars, not 😎 but I doubt that's your problem. You would get an error when creating the feature class, not when trying to create a feature. Can you create a new feature using the ArcMap Editor? It's a long shot but it may give you a better error message if it can't create the feature. Also, have you used ArcCatalog to examine the spatial reference properties (xy domain, tolerance, resolution, etc.)? The developer help topic for IFeatureWorkspace.CreateFeatureClass has several examples that you may want to take a look at as well. They show how to use the FieldChecker class to validate your fields collection.
... View more
03-07-2011
07:58 AM
|
0
|
0
|
2301
|
|
POST
|
The search tolerance is a document property. You set it in the options dialog (Selection menu->Options) - it affects such things as the Select Features tool, Identify tool, etc. In many cases it's a good idea to use the search tolerance because it's something the user can change on their own but in your case you probably do want to use a tighter tolerance. Also, I'm not sure if the snap tolerance will automatically be used when you split your line. You may have to use IProximityOperator to get the actual point on the line and use that point in your split operation.
... View more
03-07-2011
07:45 AM
|
0
|
0
|
2345
|
|
POST
|
Something like this: Do Until pPointF Is Nothing
Dim pPoint As IPoint
Set pPoint = pPointF.Shape
Dim topoOp As ITopologicalOperator
Set topoOp = pPoint
Dim bufferPoly As IPolygon
Set bufferPoly = topoOp.Buffer(pMxDoc.SearchTolerance)
Dim pSF As ISpatialFilter
Set pSF = New SpatialFilter
With pSF
Set .Geometry = bufferPoly
.GeometryField = "Shape"
.SpatialRel = esriSpatialRelIntersects
End With
... View more
03-07-2011
05:57 AM
|
0
|
0
|
2345
|
|
POST
|
I don't have any problems executing the following code. Maybe you'll see something that you're doing differently. Let me know how it goes. Try
Dim mxDocument As IMxDocument = DirectCast(m_application.Document, IMxDocument)
Dim map As IMap = mxDocument.FocusMap
Dim standaloneTableCollection As IStandaloneTableCollection = DirectCast(map, IStandaloneTableCollection)
Dim standAloneTable As IStandaloneTable = standaloneTableCollection.StandaloneTable(0)
Dim table As ITable = standAloneTable.Table
Dim dataset As IDataset = DirectCast(table, IDataset)
Dim workspace As IWorkspace = dataset.Workspace
Dim workspaceEdit As IWorkspaceEdit = DirectCast(workspace, IWorkspaceEdit)
If Not workspaceEdit.IsBeingEdited Then workspaceEdit.StartEditing(True)
workspaceEdit.StartEditOperation()
Dim insertCursor As ICursor = table.Insert(True)
Dim rowBuffer As IRowBuffer = table.CreateRowBuffer
Dim index As Int32 = table.Fields.FindField("scenario_id")
rowBuffer.Value(index) = "test scenario"
Dim oid As Int32 = Convert.ToInt32(insertCursor.InsertRow(rowBuffer))
workspaceEdit.StopEditOperation()
Marshal.ReleaseComObject(insertCursor)
Marshal.ReleaseComObject(rowBuffer)
workspaceEdit.StartEditOperation()
insertCursor = table.Insert(True)
rowBuffer = table.CreateRowBuffer()
rowBuffer.Value(index) = "test scenario"
insertCursor.InsertRow(rowBuffer)
workspaceEdit.StopEditOperation()
Marshal.ReleaseComObject(insertCursor)
Marshal.ReleaseComObject(rowBuffer)
workspaceEdit.StopEditing(True)
Catch ex As Exception
MessageBox.Show(ex.ToString)
End Try
... View more
03-04-2011
10:31 AM
|
0
|
0
|
2976
|
|
POST
|
Have you tried get a fresh reference to the feature class by calling OpenFeatureClass instead of using the reference returned by CreateFeatureClass?
... View more
03-04-2011
10:02 AM
|
0
|
0
|
2301
|
|
POST
|
Can't you get a new cursor in between the call to StopOperation for one edit and the call to StartOperation for the next edit? You don't have to stop the edit session as the error seems to be complaining about the operation, not the session.
... View more
03-03-2011
09:04 AM
|
0
|
0
|
2976
|
|
POST
|
If you want undo/redo functionality then you will probably have to get a new cursor for each edit. I don't know for sure, but it could be that operations cannot be supported inside the same cursor. That kind of makes sense when you think about it. Cursors in ArcObjects are forward-only so how do you go back and undo an edit? The solution is probably to just dump the whole cursor. This may have been a bug that ESRI fixed. For instance, the definition of a shapefile requires that the attribute table have at least one field (the FID and Shape fields don't count because they aren't stored in the .dbf file). This is why you always have that Id field when you create a shapefile through ArcCatalog and you can't delete it unless you add another field. At one time, you could create a shapefile through code with no attribute fields even though that was a violation of the shapefile definition. ESRI eventually fixed this bug and now you can't do that. The side effect of this bug fix is that it broke a lot of (incorrect) code. This may be the case here with your code. Again, that's just a theory. Try getting a new cursor for each edit and see if that fixes the problem.
... View more
03-03-2011
04:54 AM
|
0
|
0
|
2976
|
|
POST
|
In your call to StartEditing you're specifying that you want undo/redo capability. Unless you're implementing this functionality I would pass in False. Is there any reason why you need to enclose each edit in its own operation? If not, then just use a single operation - start editing, start operation, perform all edits, stop operation, stop editing. I can't say that I've ever tried to use the same cursor in multiple operations.
... View more
03-03-2011
04:29 AM
|
0
|
0
|
2976
|
|
POST
|
It is saying the exception was thrown in Microsoft.VisualBasic.dll. That means the exception is not being thrown in your code. Also, anytime an exception is thrown you will see this "first chance exception" message in your debug window. All this means is that an exception was thrown. If you don't see a corresponding "second chance exception" message then that means the exception was handled by the code wherever that exception was thrown. Since you're not seeing this second message then it's doubtful it's anything you need to worry about.
... View more
03-02-2011
08:24 AM
|
0
|
0
|
711
|
|
POST
|
One thing to keep in mind before you spend any money is that Microsoft is dropping the out-of-the-box deployment project template in the next release of Visual Studio. The last version to include the deployment project template will be Visual Studio 2010. Future versions will include a "lite" version of InstallShield.
... View more
03-02-2011
05:07 AM
|
0
|
0
|
742
|
|
POST
|
Most, if not all, of the geoprocessor tool classes take references to the actual objects you're operating on instead of text strings. In your case, you're passing in a text string for the input object class. You need to be passing in the actual feature class or table. Also, I'm not sure I'd bother with all of the overhead of using the geoprocessing environment just to add a field to an object class. Just create the new field and call the AddField method on the table or feature class.
... View more
03-02-2011
04:47 AM
|
0
|
0
|
1209
|
|
POST
|
The MapControl doesn't have a document, only a map. You can load it using an mxd but it's not the document that loads, just the layers in the map. The selected layer is a property of the TocControl, not the MapControl.
... View more
03-02-2011
04:40 AM
|
0
|
0
|
776
|
|
POST
|
This code uses the tool's ProgId: pUID.value = "esriCore.SketchTool" It has been my experience that using the ProgId requires the command or tool to be on a toolbar or menu somewhere. If you use the actual class GUID, then the command or tool does not have to be on a toolbar or menu: pUID.value = "{" & yourClass.ClassId & "}" The code above is .NET and assumes the command/tool class is in your code project. You can also just use the hard-coded GUID (you'll have to do this for built-in tools and tools whose code is not in your project).
... View more
03-01-2011
05:06 AM
|
0
|
0
|
1784
|
| 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
|