|
POST
|
It's on MapView, not Map. So it should be MapView.Active.Redraw(true) and not MapView.Active.Map...
... View more
03-25-2019
07:32 AM
|
0
|
1
|
2215
|
|
POST
|
We think this is a bug, but haven't figured out the cause or how hard it is to fix. Is using findAndReplaceWorkspacePath an acceptable work-around? --Rich
... View more
03-15-2019
07:30 AM
|
0
|
1
|
2955
|
|
POST
|
Hi Ave, We are investigating this situation now. I'll respond again when I have more information to share. Thanks, --Rich
... View more
03-14-2019
09:26 AM
|
0
|
0
|
2955
|
|
POST
|
Oops, sorry about that. The numbers for my 5 runs vary between 2438 and 2874, with an average of 2572 milliseconds.
... View more
03-13-2019
10:24 AM
|
0
|
0
|
2939
|
|
POST
|
Matt-- I created a simple feature class in a file geodatabase and executed the following code in an add-in. private string InsertRecords()
{
var geodb = new ArcGIS.Core.Data.Geodatabase(new ArcGIS.Core.Data.FileGeodatabaseConnectionPath(new Uri("path to file geodatabase")));
var fc = geodb.OpenDataset<FeatureClass>("InsertionTest");
var fcDefinition = fc.GetDefinition();
string shapeFieldName = fcDefinition.GetShapeField();
var buffer = fc.CreateRowBuffer();
DateTime start = DateTime.Now;
for (int i = 0; i < 1000; ++i)
{
buffer["Name"] = "a name";
buffer["WidgetCount"] = i;
buffer[shapeFieldName] = ArcGIS.Core.Geometry.MapPointBuilder.CreateMapPoint(i * .01, 0, 0);
fc.CreateRow(buffer).Dispose();
}
DateTime end = DateTime.Now;
TimeSpan elapsedTime = end - start;
fc.Dispose();
geodb.Dispose();
return string.Format("{0} milliseconds", elapsedTime.Milliseconds);
} The only real change I made to your code (besides my original set of suggestions) was to call Dispose() on the row returned from FeatureClass.CreateRow(). I ran the code 5 times, and it averaged 608 milliseconds, much faster than the 10 seconds you are seeing. I would suggest submitting an incident to technical support- maybe they can determine if there is something wrong with your file geodatabase. As for the geoprocessing questions, I'm the product engineer for the Geodatabase Pro SDK, and this is outside of my area of expertise. Hopefully someone on the Geoprocessing team can comment. --Rich
... View more
03-13-2019
09:43 AM
|
0
|
1
|
2939
|
|
POST
|
Matt- There's no geoprocessing code in the sample you included above. Do you have any software components that are listening to edit events? --Rich
... View more
03-12-2019
07:10 PM
|
0
|
3
|
2939
|
|
POST
|
Hi Matt, A couple of things to try: 1. Create and reuse a single RowBuffer rather than creating a new one every time through the loop. 2. Set the shape in the RowBuffer before creation rather than updating the row after creation. buffer[shapeFieldName] = ArcGIS.Core.Geometry.MapPointBuilder.CreateMapPoint(i * .01, 0) As a general rule when editing inside an Add-in, you should consider using the EditOperation class, which redraws the screen and modifies the undo/redo stack. However, if your data hasn't been added to a map yet, and you have no need for undo, then this code is fine. Hope this works, --Rich
... View more
03-12-2019
11:16 AM
|
0
|
0
|
2939
|
|
POST
|
Sverker, CoreHost applications don't have access to any of the ArcGIS.Desktop assemblies. To execute a geoprocessing tool, you have to shell out to an external process and call Python directly. --Rich
... View more
02-25-2019
07:20 AM
|
2
|
4
|
4964
|
|
POST
|
Hi Daniel, This isn't an answer to the generic question about IPluginWrapper, but in this particular case, I think you are looking for the SaveEditsAsync method on ArcGIS.Desktop.Core.Project. I hope this helps, --Rich
... View more
02-14-2019
10:04 AM
|
2
|
1
|
1400
|
|
POST
|
Hi Zeno, Unfortunately, this functionality is not included in the Pro SDK, and we don't have any near-term plans to add it. I cannot think of any sure-fire workarounds, but you might be able to get by with some of these ideas: Prefix the tablenames with something like "MyProductSystemTable." This should stop all but the most malicious users from writing to the tables (although the more curious might try to read them). Store your actual data in a blob or encrypted text string, which would prevent the read case (but again, won't stop a malicious writer from just clobbering the whole thing) Create a username/password for a system user and use a different database connection for reading these tables. Hardcode these values in your app- the system admin would need to run a script to create this other user. None of these give you what you had with workspace extensions, but I hope they are useful ideas at least. --Rich
... View more
02-13-2019
02:58 PM
|
1
|
1
|
1200
|
|
POST
|
One idea would be to write some test code that steps through every row in the table and see if one of them is corrupt in some way. The only other suggestion I have is to log this one with technical support. I don't have any idea what could cause this error. --Rich
... View more
02-01-2019
08:46 AM
|
0
|
1
|
2593
|
|
POST
|
We read the spatial type from the first feature that we find. Without an Order By, you can get features back in variable order- this would explain why it sometimes worked and sometimes didn't. As for the spatial reference error, I don't have any immediate ideas. What line of SDK code is causing the error? --Rich
... View more
01-31-2019
03:51 PM
|
0
|
3
|
2593
|
|
POST
|
Thomas, Could you try setting the QueryDescription shape type? For example, add the following after line 15 above: queryDescription.SetShapeType(GeometryType.Polyline); // assuming the underlying geometry type is polyline I hope this helps, --Rich
... View more
01-30-2019
03:11 PM
|
1
|
5
|
2593
|
|
POST
|
Hi Mody, The easiest way would be to add the table to the table of contents in the map and access it from there. This will keep it open. Another way to do this would be to create a class like the following: class MyLogger : IDisposable {
private Table _logTable = null; //instance variable – pins the table when assigned to prevent it going out of scope
// Initialize the logger object
internal Task InitializeAsync() {
QueuedTask.Run(() => {
Using(var gdb = new Geodatabase(...) {
//assign it
_logTable = gdb.OpenDataset<Table>(…)
}
});
}
//use it
Internal Task<bool> LogAsync(string message)
{
//declare on the UI is ok
Var editop = new EditOperation() { ….
//will be called on the QueuedTaskRun
editOp.Callback( context => {
//do your thing…using the instance member
Using(var rb =_logTable.CreateRowBuffer()) {
}
}, _logTable);
return editOp.ExecuteAsync();
}
//clean up
Private void Dispose() {
_logTable.Dispose();
_logTable = null;
}
}
I hope this helps, --Rich
... View more
01-30-2019
01:21 PM
|
0
|
0
|
952
|
| Title | Kudos | Posted |
|---|---|---|
| 1 | 12-13-2024 11:22 AM | |
| 2 | 01-29-2026 09:34 AM | |
| 2 | 01-28-2026 08:20 AM | |
| 1 | 12-10-2025 09:15 AM | |
| 2 | 11-30-2025 12:23 PM |
| Online Status |
Offline
|
| Date Last Visited |
3 weeks ago
|