|
POST
|
Hi Denny Peltz, As you can see from my reply I didn't even check if a range is allowed 😞 Thanks for pointing this out, one should never underestimate the capabilities of Pro 🙂
... View more
10-02-2020
11:06 AM
|
1
|
0
|
1588
|
|
POST
|
Hi Muhammet İkbal Yaşar, Can you provide more detail on which SDK functionality you are having a problem with? Is it an API function or a GP tool?
... View more
10-02-2020
09:37 AM
|
0
|
3
|
4215
|
|
POST
|
Hi Denny Peltz, there is no 'highest' pro version that can limit the usage of an add-in. I would recommend to check the 'high' version limit of an add-in in code after reading the Pro version: var versionStr = System.Reflection.Assembly.GetEntryAssembly().GetName().Version.ToString();
... View more
10-02-2020
09:24 AM
|
1
|
0
|
1588
|
|
POST
|
Hi Than Aung, I can't speak to your tools and I think that Amir is answering your questions to that regard, but as far as calling a geoprocessing tool from .Net I noticed that IGPResult doesn't return all warnings/error strings in all cases and in some cases i get a wrong success status. So I call ExecuteToolAsync using the callback parameter to examine 'OnValidate' message types in the call back. In some cases, like for example in the sample below errors are only coming back via the 'OnValidate' callback. protected override async void OnClick()
{
// get the testpoint layer
try
{
var layerName = "TestPoints";
var field = "Description";
var expression = "'Test'";
var featureLayer = MapView.Active.Map.GetLayersAsFlattenedList().OfType<FeatureLayer>().Where(fl => fl.Name.Contains(layerName)).FirstOrDefault();
var msg = await CalcFieldGeoprocessingAsync(featureLayer, field, expression);
MessageBox.Show($@"Calc field returned: {msg}");
}
catch (Exception ex)
{
MessageBox.Show($@"{ex}");
}
}
// cancellation token
private System.Threading.CancellationTokenSource _cts = new System.Threading.CancellationTokenSource();
public async Task<string> CalcFieldGeoprocessingAsync(FeatureLayer selectionLayer,
string field, string expression)
{
return await QueuedTask.Run<string>(async () =>
{
var stringBuilder = new StringBuilder();
using (FeatureClass featureClass = selectionLayer.GetFeatureClass())
{
string in_table = featureClass.GetPath().ToString();
IReadOnlyList<string> calculateParameters = Geoprocessing.MakeValueArray(new object[] { in_table, field, expression });
var stopWatch = new Stopwatch();
stopWatch.Start();
IGPResult result = await Geoprocessing.ExecuteToolAsync("management.CalculateField",
calculateParameters, null, _cts.Token,
(eventName, o) =>
{
System.Diagnostics.Debug.WriteLine($@"GP event: {eventName}");
switch (eventName)
{
case "OnValidate": // stop execute if any warnings
if ((o as IGPMessage[]).Any(it => it.Type == GPMessageType.Warning))
_cts.Cancel();
foreach (var str in (o as IGPMessage[]))
{
stringBuilder.Append($@"Warning: {str}");
}
break;
case "OnProgressMessage":
string msg = $@"{eventName}: {(string)o}";
break;
case "OnProgressPos":
string msg2 = $@"{eventName}: {(int)o} %";
stringBuilder.Append(msg2);
break;
}
});
stopWatch.Stop();
// Report the results
if (result.IsFailed)
{
stringBuilder.Append("GP Tool failed: ");
foreach (IGPMessage message in result.Messages)
{
stringBuilder.AppendLine(message.ToString());
}
}
else
{
stringBuilder.Append("Updating rows without an edit operation took: ");
stringBuilder.Append($@"{Math.Round(stopWatch.ElapsedMilliseconds / 1000.0, 0)} seconds");
}
return stringBuilder.ToString();
}
});
}
... View more
09-29-2020
10:31 AM
|
1
|
2
|
7305
|
|
POST
|
Hi Brian Bulla, I attached my SDE (Sql Server) geodatabase which has been copied by the map package geoprocessing tool into a file geodatabase. Let me know if anything is missing.
... View more
09-23-2020
08:11 AM
|
2
|
1
|
1225
|
|
POST
|
Hi Brian Bulla, I asked Chris to reach out to you and get you going with the support issue. He should chime in here soon. Thanks for your patience.
... View more
09-22-2020
02:16 PM
|
0
|
0
|
1225
|
|
POST
|
Hi Brian Bulla, I tried Pro 2.6.1 to no avail, I am not able to duplicate the issue. I also talked it over with some colleagues and we concluded that at this point the issue must be with the data and/or SDE compatibility. I think that at this time it's best to have Esri support investigate this issue since they are better suited to look at the SDE and database aspects of your system.
... View more
09-22-2020
07:26 AM
|
0
|
6
|
1710
|
|
POST
|
Hi Brian Bulla, Not sure if you seen my previous reply,,, I am using 2.6.0 (not patched), what version of Pro are you using? I also don't see the additional digits for the coordinates you are seeing in the MessageBox (see previous reply). What version of Visual Studio are you using? If I can't duplicate this issue we'll give it to support.
... View more
09-22-2020
07:03 AM
|
0
|
8
|
1710
|
|
POST
|
Remove / Add overlay didn't work for me either, it seems to be too asynchronous (random) when the map is actually refreshed. The best way I found to do this (even so I didn't have to flash my geometry, instead I just moved it) was to use UpdateOverlay with a symbol color that is opposite on the color wheel.
... View more
09-22-2020
06:59 AM
|
0
|
1
|
5864
|
|
POST
|
Hi Thomas Becker, I used the following code snippet to change the data source for my feature layers: private async void ChangeDatasource(FeatureLayer featLayer, string newGDB)
{
await QueuedTask.Run(() =>
{
// provide a replacement data connection object
CIMDataConnection updatedDataConnection = new CIMStandardDataConnection()
{
WorkspaceConnectionString = $"DATABASE={newGDB}",
WorkspaceFactory = WorkspaceFactory.FileGDB,
DatasetType = esriDatasetType.esriDTFeatureClass,
Dataset = featLayer.Name
};
// the updated Data connection should look like this:
// CustomWorkspaceFactoryCLSID: null
// Dataset: "TestMultiPoints"
// DatasetType: esriDTFeatureClass
// WorkspaceConnectionString: "DATABASE=C:\\Data\\FeatureTest\\FeatureTest.gdb"
// WorkspaceFactory: FileGDB
// overwrite the data connection
featLayer.SetDataConnection(updatedDataConnection);
});
} In my tests (using 2.6) I didn't need to refresh the map view, the content of my replacement data was immediately displayed.
... View more
09-21-2020
04:21 PM
|
0
|
1
|
4321
|
|
POST
|
Thanks Brian Bulla, I am not able to duplicate the problem even with your geometry (that I loaded into the same app i sent you). I am using 2.6.0 (not patched), what version of Pro are you using? I also don't see the additional digits for the coordinates you are seeing. What version of Visual Studio are you using?
... View more
09-21-2020
08:38 AM
|
1
|
9
|
1710
|
|
POST
|
Hi Brian Bulla I setup and tested the SQL Server enterprise geodatabase configuration and was not able to duplicate your issue. I even used your projection to no avail. So i made a new test add-in (GeoNet259853-v2.zip) for you that 'captures' and saves the geometries that are causing the issue. Please use the test add-in with your data (i think all layer names should be the same as on your map). Follow these steps: Build the new test add-in Open Pro with your water service map. Make sure that the "selection settings" are only checked for WaterService and Fitting: From the add-in tab use the "Create Service Connection" tool to create a service connection Once you create a service connection you can then click the 'Rectangle' button and select the 'end point' of the newly created service connection Once the end point (and the service line) are selected, you then click 'Selection Coincidence' to check for the error. Once you duplicate the 'coincident: false' error, click the "Export Geometry" button to save the "serialized geometries" in a json file. Send me the json file so that i can take a look at the geometries myself. I hope we'll get a duplicatable case from this.
... View more
09-19-2020
01:11 PM
|
0
|
11
|
1710
|
|
POST
|
Hi Brian Bulla, I will try your environment today. If i can't duplicate the problem with that setup, I will send you a test program with code that serializes the 'sketch' geometry to a file. This way i should be able to use your sketch to duplicate the issue.
... View more
09-18-2020
07:57 AM
|
1
|
0
|
1710
|
|
POST
|
I think SQL backend could possibly be an issue, because internally the geometry data is stored in a different format from a file geodatabase (where it works). If you tell me what database you are using, I will try it here and see if I can duplicate the issue.
... View more
09-17-2020
01:55 PM
|
0
|
14
|
1710
|
|
POST
|
I created a test add-in (attached: GeoNet259853-Add-in.zip) and I was not able to duplicate the problem with my Pro project (also attached: GeoNet259853.mpkx). I was not able to test with your data since the feature classes didn't come across with your map package (probably due to the fact that your data is enterprise data) so I made up my own data - it's a different projection and also a file geodatabase and not an enterprise geodatabase. Maybe you can try to duplicate is issue by using GeoNet259853-Add-in. The way the test works is: Use the 'Create Service Connection' tool to create a new service connection. To do so snap the 'from' point of a water main, then add 1 or more vertices. Use the 'select by rectangle' tool to select the 'plug' end point of the newly create service connection line. Click the 'Selection Coincidence' button to see if the 'fitting' end point is coincident with the service line's 'to' point. You should get a message showing if the coordinates are coincident and the actual x/y pairs. If you can duplicate the issue with this add-in and your data we might have a problem that is related to the use of Enterprise geodatabases. Also since the coordinates are limited by the domain's x/y resolution (see above), the coordinates might differ on the least significant digits, but the coincidence check using 'MapPoint.IsEqual' should account for that (as in toPoint.IsEqual(pntFitting) ). Anyways let me know what you find and also what RDBMS are you using (SQL server/Oracle)
... View more
09-17-2020
10:01 AM
|
0
|
16
|
3855
|
| Title | Kudos | Posted |
|---|---|---|
| 1 | 10-29-2025 10:48 AM | |
| 1 | 05-24-2021 09:04 AM | |
| 1 | 12-03-2020 08:44 AM | |
| 1 | 10-07-2025 07:27 AM | |
| 2 | 12-29-2025 10:03 AM |
| Online Status |
Offline
|
| Date Last Visited |
05-21-2026
01:59 PM
|