|
POST
|
There may be multiple features in different feature classes and multiple rows in multiple tables edited within the same operation. This way the undo stack does not point to a single objectid. It points to a state in the database (sde or filegdb.) The geodatabase keeps track of all the edits through states. All the edits that belong to the same operation belong to the same state so when you undo you are potentially undoing multiple changes. If you are dealing with a remote database (sde) you could figure out the inner workings of sde and try to do your non-arcobjects updates that way. The risk of course is esri changing all the plumbing while keeping the programming interface intact, which they have done a few times already. To do edits to outside tables like you describe you will likely have to build your own operation stack through custom code and keep them in sync.
... View more
11-05-2010
12:46 PM
|
0
|
0
|
728
|
|
POST
|
The dockable window has a userdata property. The way I did it in the past was to define my own custom class that userdata returns. This class in turn has a reference to the windows custom control that implements IDockable window. You can then get a reference to the Idockablewindow, get the user data, cast it to your MyCustomDockWindowClass and call the property from there. Pardon the VB.NET Public Class MyCustomDockWindowClass
Implements IDockableWindowDef
Private m_userData As customUserData
Public Sub OnCreate(ByVal hook As Object) Implements IDockableWindowDef.OnCreate
m_application = CType(hook, IApplication)
m_userData = New customUserData(Me)
end sub
Public ReadOnly Property UserData() As Object Implements IDockableWindowDef.UserData
Get
Return m_userData
End Get
End Property
End Class
Public Class customUserData
Private m_DockableWindow As MyCustomDockWindowClass
Public Sub New(ByVal DockableWindow As MyCustomDockWindowClass)
m_DockableWindow = DockableWindow
End Sub
Public Property MyText() As string
Get
Return mytextbox.text
End Get
Set(value as string)
mytextbox.text = value
End Set
End Property
Public ReadOnly Property DockableWindow() As IPolarisEditorDockableWin
Get
Return m_DockableWindow
End Get
End Property
End Class Now you can go one step further by defining interfaces for these classes so they can work from code in a different dll (as long as they have a reference to the first dll)
... View more
11-04-2010
10:50 AM
|
0
|
0
|
1519
|
|
POST
|
Have you tried refreshing the TOC directly (contentsview) something like this: for i=0 to pMxDoc.contentsviewcount -1 pMxDoc.Contentsview(i).refresh() next
... View more
11-04-2010
10:28 AM
|
0
|
0
|
561
|
|
POST
|
The PreExpression is VBA. So even if this is vb.net, you are asking the calculator to do VBA. Same as if you put the expression in the calculate in the table view. If it was me I would ditch the calculator and just loop through your update cursor, get the area by casting the feature shape to IArea and set the area field manually. That way I don't have to mix and match programming languages. Depending on the number of rows, performance might be a consideration though.
... View more
11-03-2010
01:45 PM
|
0
|
0
|
1275
|
|
POST
|
if you use e.toString instead of e.Message, you get the call stack of the error and even the line number if you are running debug code. Showing the user a message box with the error message is not very useful in my experience. I usually log the message somewhere (file or event log) and pop up a message that an error happened and there is a message in a log. The user can then send the log to support. I typically write the message to the trace and have a trace listener write it to a log. That allows you to change how you log things without code changes. Also when you run in debug mode in VS, the trace gets written to the output window so there is no need for message boxes. However, message boxes are useful in debug mode because they are annoying. A developer sufficiently annoyed by a message box will fix it rather than just ignore it.
... View more
11-02-2010
12:28 PM
|
0
|
0
|
355
|
|
POST
|
Does the PGDB exist at the path specified? If it does have you tried openFromFile? If it doesn't you need to created the PGDB before you can open it. If the schema is always the same I found the easiest is to create an empty template PGDB somewhere in your project and copy and rename that one when you need it.
... View more
11-01-2010
07:25 AM
|
0
|
0
|
458
|
|
POST
|
Well there is at least 3-4 more elegant ways of doing this sort of thing depending on the nature of the operations the code is doing. However if you just want to migrate changing the least things to your design, there is a MxDocument_OpenDocument event in C#. You need to create an ArcMap extension and create a listener in the oncreate event of the extension to the IDocumentEvents OpenDocument event and put your code in there. Putting the code in the oncreate of the event is a possibility too but typically ArcMap is not finished loading at that time.
... View more
10-28-2010
08:54 AM
|
0
|
0
|
1459
|
|
POST
|
Well there are many cartesian rectangular coordinate system. Strictly speaking a Plate Carree projection is a cartesian rectangular coordinate system using longitude and latitude as X,Y. if you are trying to go from the screen coordinates in pixel to the map coordinates in whatever system the map is defined IMapControl2.ToMapPoint will do that. If you are looking to go from a specific projected coordinate system (X/Y) to a geographic one (lon/lat), you can create a point, define it's projected coordinate system, project the point to a geographic coordinate system (of the same datum.)
... View more
10-26-2010
05:17 AM
|
0
|
0
|
303
|
|
POST
|
It is likely that the layer's areaOfInterest is empty. This happens if the featureclass is empty but it could happen other ways too. Typically, zoom to layer zooms to the extent of the data. I know there are some times problems where the AOI no longer reflects the extent of the data if a bunch of features are deleted. ILayer2 has read/write on it. Shapefiles get their AOI differently so it is possible they work fine without setting it. http://forums.esri.com/Thread.asp?c=93&f=992&t=67243
... View more
07-22-2010
06:44 AM
|
0
|
0
|
558
|
|
POST
|
Have you tried calling createfeaturebuffer from within the loop where you insert the features. I have always created a new featurebuffer for each individual feature I insert.
... View more
07-08-2010
05:48 AM
|
0
|
0
|
532
|
|
POST
|
You need ArcGIS desktop and the ArcGIS desktop dev kit. Also you need to install the ArcGIS Devkit after VS so it integrates with it.
... View more
07-07-2010
11:04 AM
|
0
|
0
|
353
|
|
POST
|
The answer is it depends on what specifically you are trying to do. If you are trying to change the spatial reference of a feature class, the answer is no. Typically you would create a new featureclass with the other spatial reference and copy all the features over (which will project them.) If you are trying to change the spatialreference of a geometry, you can call the project method.
... View more
07-05-2010
05:31 AM
|
0
|
0
|
683
|
|
POST
|
If you look at the help for IworkspaceFactoryschemacache, it is only implemented for SDEworkspacefactory. You are using an OLEWorkspaceFactory... The schema cache is only meant for sde schema caching.
... View more
06-30-2010
06:28 AM
|
0
|
0
|
479
|
|
POST
|
One last thing I forgot to mention, if the map has no layers, calling IMap.Layers returns an exception so make sure you check that the layer count is not zero first.
... View more
06-24-2010
06:18 AM
|
0
|
0
|
861
|
|
POST
|
There is an ESRI snippet for this called Loop through layers of specific uid. Basically uses the IMap.layers with the UID of the Ifeaturelayer (see snippet or help for the IMap.layers method.) Also the second argument is to search recursively, setting it to true will search layers inside group layers.)
... View more
06-24-2010
06:17 AM
|
0
|
0
|
861
|
| Title | Kudos | Posted |
|---|---|---|
| 1 | 12-02-2024 10:26 AM | |
| 1 | 07-05-2024 08:45 AM | |
| 1 | 10-05-2022 02:19 PM | |
| 6 | 03-27-2017 01:16 PM | |
| 1 | 05-05-2016 05:46 AM |
| Online Status |
Offline
|
| Date Last Visited |
03-28-2025
07:37 AM
|