POST
|
Thanks! I can provide more information now after additional testing. The code to open the OpenItemDialog is executed from a Pro button. When I launch Pro and click the button for the first time, the OpenItemDialog loads, but it shows all types of shapefiles (file geodatabases are excluded). After I cancel from the dialog and click the button again, the OpenItemDialog now correctly shows only line shapefiles. From this point on the filter works correctly. Any ideas why this is happening? Here is the BrowseProjectFilter configuration: BrowseProjectFilter browseFilter = BrowseProjectFilter.GetFilter("esri_browseDialogFilters_shapefiles"); browseFilter.AddCanBeTypeId("shapefile_general"); browseFilter.AddMustNotBeTypeId("shapefile_polygon"); browseFilter.AddMustNotBeTypeId("shapefile_point");
... View more
11-05-2020
04:40 PM
|
0
|
1
|
1553
|
POST
|
Thanks Uma! This is not working for me though. The filter alone without AddCanBeTypeId's shows shapefiles of all geometry types: BrowseProjectFilter browseFilter = BrowseProjectFilter.GetFilter("esri_browseDialogFilters_shapefiles"); OpenItemDialog browseDialog = new OpenItemDialog {….} With the AddCanBeTypeId lines added, I still see shapefiles of all geometry types. I also see file geodatabases located in the same folder, and can navigate to the feature classes in the file geodatabases: BrowseProjectFilter browseFilter = BrowseProjectFilter.GetFilter("esri_browseDialogFilters_shapefiles"); browseFilter.AddCanBeTypeId("shapefile_general"); browseFilter.AddCanBeTypeId("shapefile_line"); OpenItemDialog browseDialog = new OpenItemDialog {….}
... View more
11-04-2020
02:01 PM
|
0
|
3
|
1553
|
POST
|
I am trying to configure BrowseProjectFilter of OpenItemDialog so only line shapefiles can be selected. Here is the code I am using: BrowseProjectFilter browseFilter = BrowseProjectFilter.GetFilter("esri_browseDialogFilters_shapefiles"); OpenItemDialog browseDialog = new OpenItemDialog { Title = "Select line shapefile", MultiSelect = false, BrowseFilter = browseFilter }; browseDialog.ShowDialog(); This returns shapefiles of all geometry types. Is there a way to configure the filter to display shapefiles with line geometry type only? I have tried applying the AddCanBeTypeId below but it does not make any difference. browseFilter.AddCanBeTypeId("shapefile_line"); I am using Pro 2.6 SDK. Thanks!
... View more
11-03-2020
12:07 PM
|
0
|
5
|
1605
|
POST
|
In the Pro SDK API, I am getting the "Incompatible spatial references" error when performing Geometry Engine operations like Distance or Difference on two geometries. The first geometry comes from a feature in an enterprise geodatabase feature class contained in a feature dataset. The second feature comes from a file geodatabase feature class created programmatically, with the spatial reference copied from the SDE feature class. When I look at spatial references of both geometry objects in debug mode, they have identical WKT strings. The workaround I found was to convert both geometries to JSON and re-create them from the JSON strings. The Geometry Engine operations no longer fail. My understanding is that as long as spatial reference WKT strings for two geometries are identical, their spatial references are the same. Is there something I am missing? Could this possibly be a bug? I am using Pro 2.6 SDK. Thanks.
... View more
10-29-2020
09:04 AM
|
1
|
4
|
1220
|
POST
|
When editing geodatabase programmatically in short transaction mode (we are working with non-versioned enterprise geodatabase tables), a failed chained operation does not cause the parent operation to be rolled back. Is this an expected behavior? If so, can anyone suggest a solution to this? Thanks!
... View more
10-26-2020
11:48 AM
|
0
|
2
|
715
|
POST
|
Found the answer with colleague's help. The missing reference was ArcGIS.Desktop.Layouts.
... View more
09-17-2020
02:01 PM
|
0
|
0
|
669
|
POST
|
I am trying to add a graphics element to a graphics layer using Pro SDK 2.6. For some reason the AddElement method and the other extension methods that come from GraphicsLayerExtensions are not recognized. Visual Studio reports the following: 'GraphicsLayer' does not contain a definition for 'AddElement' and no accessible extension method 'AddElement' accepting a first argument of type 'GraphicsLayer' could be found (are you missing a using directive or an assembly reference?). Is there a reference that needs to be added? Thanks! GraphicsLayer graphicsLayer = GetGraphicsLayer(); CIMLineGraphic lineGraphic = new CIMLineGraphic() { Symbol = lineSymbol, Line = polyline }; graphicsLayer.AddElement(lineGraphic);
... View more
09-17-2020
12:30 PM
|
0
|
1
|
715
|
POST
|
Is there a way to programmatically activate a TOC View? Specifically, I would like to make the Snapping View visible (esri_mapping_SnappingView). Thanks!
... View more
09-09-2020
08:04 AM
|
0
|
1
|
560
|
POST
|
I am looking to put together custom Add and Modify editing tools for a particular line feature class. The Add tool will allow to sketch the geometry of a new feature, specify attributes via a custom form and then save the feature. The Update tool will use a feature selection in the map. The user will use Next/Previous buttons in the attribute form to edit attributes and geometry of current feature and save it. What is the recommended architecture for these tools? The sketch tool for the feature geometry can be placed on the ribbon or in a feature template. The attribute form can be implemented as a dockable window or an embedded control to be placed in the feature template panel. One additional question: when modifying feature geometry, what is the proper way to do it? How to programmatically activate the sketch tool with a particular feature selected so its vertexes can be edited? Thanks for any pointers!
... View more
09-08-2020
10:28 AM
|
0
|
0
|
392
|
POST
|
Great workaround! Thanks very much for the help, Wolfgang!
... View more
09-01-2020
02:13 PM
|
0
|
0
|
823
|
POST
|
Another question about TableControl. I have implemented a custom Attribute Table dockable panel which works exactly like the out-of-the-box one in Pro. The user right-clicks a layer, chooses the option to display the attribute table and a new tab is added to the tab control in my dockable panel (or an existing tab is activated). Now I am trying to add a right-click context menu to each attribute table so the user can zoom to a feature or flash feature. The TableControl community sample describes how to do that. The problem is that in my case the content of each tab is defined via a DataTemplate and in my view model for each tab I have access only to TabControlContent, not TableControl itself. Without TableControl I do not have access to the OID of the feature: var oid = tableControl.GetObjectIdAsync(tableControl.ActiveRowIndex).Result; I have attached the relevant files here. I will gladly provide more detail if needed. Thanks!
... View more
08-31-2020
09:20 AM
|
0
|
2
|
925
|
POST
|
I have put together a custom version of Attribute Table using the Pro SDK TableControl and the standard WPF TabControl. The problem I am having is that the state of TableControl's in each tab is not preserved. Every time I click a tab to select it to view attributes for a layer the attribute table reloads. I suspect that the issue is with the TabControl virtualization described here: WPF TabControl: Turning Off Tab Virtualization - CodeProject The proposed solution did not make any difference, not did another one that I tried. Has anyone seen this behavior and found a solution to it? Thanks!
... View more
08-20-2020
07:45 AM
|
0
|
0
|
394
|
POST
|
Thanks Uma, the code does work as expected, sorry for the confusion. There was another OnProjectClosing event handler in the solution which led to the unexpected results.
... View more
08-19-2020
06:19 AM
|
1
|
0
|
718
|
POST
|
Under a certain condition I need to prevent the user from closing both the project they have opened and the Pro application (essentially disabling the X button in the upper right corner). I have subscribed to ProjectClosingEvent and set args.Cancel to true. The project still closes while Pro does not. What should be done to keep the project open? Thanks. public Module1() { ProjectClosingEvent.Subscribe(OnProjectClosing); } private Task OnProjectClosing(ProjectClosingEventArgs args) { if (CanClosePro == false) { args.Cancel = true; return Task.FromResult(0); } else { return Task.CompletedTask; } }
... View more
08-18-2020
06:32 AM
|
0
|
2
|
749
|
Title | Kudos | Posted |
---|---|---|
1 | 10-29-2020 09:04 AM | |
1 | 08-19-2020 06:19 AM | |
1 | 08-08-2019 01:13 PM | |
1 | 03-23-2018 11:26 AM |
Online Status |
Offline
|
Date Last Visited |
11-11-2020
02:24 AM
|