POST
|
Hello, In the ArcGIS Pro SDK 3.0+, (how) is it possible to activate the selection chip programmatically? I would like to write a MapTool that interactively selects features and lets the user choose one if multiple features were clicked (same as the standard SelectyByRectangle tool). Thanks for any advice! Fridjof
... View more
03-27-2023
07:31 AM
|
0
|
1
|
222
|
POST
|
Probably I would also subscribe to the MapViewInitializedEvent, so you can analyze the layers and tables in the current map once the map view is ready.
... View more
03-01-2023
10:59 PM
|
1
|
0
|
498
|
POST
|
@KierenTinning2, I added an ArcGIS Idea for this issue. Please vote for it, anybody who would like this feature to be added.
... View more
02-12-2023
11:36 PM
|
0
|
0
|
524
|
IDEA
|
In the ArcGIS.Desktop.Editing.Attributes.Inspector class of the SDK, please provide a member for hiding fields by name (e.g., IEnumerable<string> HiddenFields {get; set;}) or displaying only a subset of fields by name. See also this post. The workaround described there is to alter the field visibility in the CIM of the underlying layer. However, there are workflows where fields should not be hidden in general, while the user should see only a subset of fields in a customized Inspector.
... View more
02-12-2023
11:27 PM
|
0
|
0
|
402
|
POST
|
Thank you Narelle, I really appreciate it and I am looking forward to working with this future release. For those interested, my current approach is this: static bool SelectFirstTemplateFromFolder(string folderName)
{
var pane = FrameworkApplication.DockPaneManager.Find(DAML.Dockpane.esri_editing_CreateFeaturesDockPane);
pane.Activate();
var paneType = pane.GetType();
var pi = paneType.GetProperty("SubPanelIndex");
pi?.SetValue(pane, 0);
pi?.SetValue(pane, 1); // Switch to Favorites
pi = paneType.GetProperty("TemplateFoldersVM");
var templateFoldersVM = pi?.GetValue(pane);
pi = templateFoldersVM?.GetType().GetProperty("RootFolderChildren");
if (pi?.GetValue(templateFoldersVM) is IEnumerable col)
{
foreach (var item in col)
{
var itemType = item.GetType();
pi = itemType.GetProperty("Name");
var name = pi.GetValue(item);
if (Equals(name, folderName))
{
pi = itemType.GetProperty("Children");
if (pi?.GetValue(item) is IEnumerable children)
{
var enumerator = children.GetEnumerator();
if (enumerator.MoveNext())
{
var child = enumerator.Current;
var childType = child.GetType();
pi = childType.GetProperty("IsSelected");
pi.SetValue(child, false);
pi.SetValue(child, true);
return true;
}
}
break;
}
}
}
return false;
}
... View more
01-30-2023
10:02 PM
|
0
|
0
|
323
|
POST
|
OK, this might be an option, but actually I was planning to go with the existing UI: Selecting a template from the list of favorites so that it appears selected, expands, and activates its default tool. It seems I can get hold of the TemplateFoldersVM in esri_editing_CreateFeaturesDockPane and its children via reflection, but I'd prefer a supported solution.
... View more
01-30-2023
04:57 AM
|
0
|
0
|
343
|
POST
|
Hello, I would like to programmatically select a feature editing template from the list of favorites. For example, when the user clicks a button, the list of favorite templates appears and the first item under a certain folder gets selected. Is there a recommended way of doing this?
... View more
01-30-2023
03:32 AM
|
0
|
4
|
358
|
POST
|
Hi sjones, unfortunately this doesn't help, because the row is getting disposed while awaiting GetZsFromSurfaceAsync.
... View more
12-07-2022
11:01 PM
|
0
|
0
|
536
|
POST
|
Thank you Charles, I will give it a try with chained edit operations, since I need this both for new and changed features. The key seems to be that the chained operation cannot be created from the RowEvent's operation inside the RowEvent itself because the parent operation is already executing (trying to do so throws an exception as documented here). A pattern that might work (I'm still testing) is: Create a chained EditOperation in the EditStartedEvent In the RowChangedEvent, get an updated shape with surface Z query - letting the parent operation complete and dispose the feature After the surface Z query and further manipulations, but still in the RowChangedEvent handler, get a fresh copy of the feature from the feature layer, and update its geometry in the previously created chained EditOperation I just want to make sure that I'm not creating chained edit operations when I don't need them (e.g., when an edit operation is started on a layer I'm not interested in). Whew, it's getting more complicated than I thought...
... View more
12-02-2022
10:34 AM
|
0
|
0
|
585
|
POST
|
This is a similar issue to what succip posted the other day. I'm trying to update Z values of a feature geometry in a RowEvent (RowCreatedEvent or RowChangedEvent), but while awaiting the Z values, it seems the feature is getting disposed. When trying to update the feature's shape in feature.SetShape(newShape), I get an ArcGIS.Core.ObjectDisconnectedException ("This object has been previously disposed and cannot be manipulated."). My code: public async void OnRowChanged(RowChangedEventArgs args)
{
var feature = (Feature)args.Row;
var newShape = this.PolylineDensifier.Densify(feature.GetShape() as Polyline, MAX_LENGTH);
var result = await MapView.Active.Map.GetZsFromSurfaceAsync(newShape);
if (result.Status == SurfaceZsResultStatus.Ok) newShape = (Polyline)result.Geometry;
newShape = (Polyline)GeometryEngine.Instance.Generalize3D(newShape, GENERALIZE_OFFSET);
UpdateMs(newShape);
newShape = (Polyline)GeometryEngine.Instance.SimplifyAsFeature(newShape, true);
feature.SetShape(newShape);
// ...
} My interpretation: Since the event handler has a void return type, the method is not awaiting the GetZsFromSurfaceAsync call and the edit operation terminates (disposing the feature) before the geometry is being updated. All my other manipulations work well if I skip updating the Z values. I also tried var result = MapView.Active.Map.GetZsFromSurfaceAsync(newShape).Result; But this call never terminates (deadlock). According to Wolfs suggestion in the aforementioned post, I migth start a new EditOperation and re-update the feature there, but to me this looks awkward because my intention was to do all manipulations within the RowEvent's operation. Also, I need the manipulations to appear as one operation on the stack, so that the user cannot undo just my manipulations while the initial create/update operation is not getting undone. How can this be achieved? Is there a way to get Z values synchronously? In ArcMap this was possible with the IFunctionalSurface.Z method, but I haven't found an equivalent in Pro (see also this post). Updating the Zs automatically in the map via ElevationCapturing.CaptureMode = Surface does not seem an option because I want to densify the geometry first and then 3D-generalize it. And updating the Zs in the BeforeSketchCompletedEvent does not seem an option because I need this behavior only for a certain feature layer, both for new features and geometry updates.
... View more
12-02-2022
06:11 AM
|
0
|
4
|
614
|
POST
|
This might work: private static async Task<bool> makeJoin(string rightTableName)
{
var pathRight = Path.Combine(Project.Current.DefaultGeodatabasePath, rightTableName);
var args = Geoprocessing.MakeValueArray(fcName, idField, pathRight, zoneField);
var test2 = await Geoprocessing.ExecuteToolAsync("management.AddJoin", args);
return !test2.IsFailed;
}
... View more
11-18-2022
06:55 AM
|
1
|
0
|
454
|
POST
|
Thanks for the hint Wolf. This works for me (where Graphics is a Dictionary<IMyObjectWithGeometry, IDisposable>): private void FlashGraphic(IMyObjectWithGeometry tag, short flashCount)
{
QueuedTask.Run(() =>
{
for (int i = 0; i < flashCount; i++)
{
MapView.Active.UpdateOverlay(Graphics[tag], tag.Geometry, _invertedSymbol);
Thread.Sleep(200);
MapView.Active.UpdateOverlay(Graphics[tag], tag.Geometry, _originalSymbol);
Thread.Sleep(200);
}
});
} It does flash the geometry, however it does not have the same animation effect as flashing a feature. Would be nice to have a built-in function for flashing geometries on the map.
... View more
11-16-2022
09:21 AM
|
0
|
0
|
937
|
POST
|
You can use PolygonBuilderEx.CreatePolygon() to create polygons from 2D or 3D coordinates, MapPoints, Segments, Multipoints, Envelopes or other Polygons, with or without Spatial Reference.
... View more
11-15-2022
12:39 AM
|
0
|
0
|
553
|
POST
|
Hi Steven, When I upgraded to 3.0 I also had some issues with unit tests. Have you checked https://github.com/EsriJapan/arcgis-pro-sdk/wiki/ProGuide-Regression-Testing? This helped me figuring out how to get my NUnit tests up and running. Key seems to be the helper classes (ArcGISTestClassAttribute, TestResolver, TestEnvironment). ProApp.TestModeInitializeAsync() seems to be required for certain operations, e.g. QueuedTask.Run(). See the attached solution for an example.
... View more
10-26-2022
11:48 PM
|
0
|
0
|
194
|
POST
|
You can use the deleteTab tag inside an updateModule tag in your Config.daml file: <modules>
<updateModule refID="esri_editing_EditingModule">
<tabs>
<deleteTab refID="esri_editing_EditingTab" />
</tabs>
</updateModule>
</modules>
... View more
10-24-2022
11:22 PM
|
1
|
0
|
476
|
Title | Kudos | Posted |
---|---|---|
1 | 03-01-2023 10:59 PM | |
1 | 11-18-2022 06:55 AM | |
1 | 10-24-2022 11:22 PM | |
2 | 07-17-2015 05:29 AM | |
2 | 11-09-2020 11:27 PM |
Online Status |
Offline
|
Date Last Visited |
11-19-2023
05:13 PM
|