POST
|
I am writing an add-in that creates a layout frame, loads some layers into it, and exports the maps as .pdf documents. This is supposed to be an unattended batch process that runs on a series of folders in a file system. When this call is made: ILayoutPane iNewLayoutPane = await FrameworkApplication.Panes.CreateLayoutPaneAsync(layout); if the focus is not on ArcGIS PRO, execution pauses until I bring PRO to the foreground and click on the new layout tab. I see in the documentation that this is supposed to be called on the GUI thread. Is there a way to make sure this is the case? This line of code is in a static method in a code module, but is not enclosed in a QueuedTask statement.
... View more
11-17-2020
11:21 AM
|
0
|
0
|
194
|
POST
|
+1 for a reference page that at least provides the name of each GP tool that can be executed using the C# Geoprocessing object. I spent most of my afternoon yesterday after upgrading from Pro 2.4 to 2.6.3. The ZonalStatisticsAsTable tool was apparently renamed to ZonalStatisticsAsTable_sa in this new version which broke my existing code. I found no documentation anywhere of this change. And this is not the first time I have had to hunt down the name of a tool. And +1 that the search function in the ArcGIS Pro SDK function is quite slow. Using Chrome on Windows 10.
... View more
11-13-2020
10:17 AM
|
1
|
0
|
1481
|
POST
|
Today I upgraded from v2.4 to v2.6.3. My calls to the ZonalStatisticsAsTable failed after the upgrade with no discernable error messages. It took me an hour to guess that the tool had been renamed from 'ZonalStatisticsAsTable' to 'ZonalStatisticsAsTable_sa' with the new version. I've been stumped a few times previously trying to get the exact name for a particular GP tool. Is there a reference that lists all of the GP tool names?
... View more
11-12-2020
03:42 PM
|
0
|
1
|
412
|
POST
|
I would like to hide the dockpane completely when the Pro client is launched. I have tried overriding the InitializeAsync() and calling the hide method on the DockPane object, but it still appears. Is there no way to hide a dockpane if it was open during the previous session of Pro?
... View more
05-26-2020
03:32 PM
|
0
|
1
|
1669
|
POST
|
We also used the metadata API in ArcMap. As suggested for Pro, I am using the Item class to retrieve the Tags from the metadata. However, I have found a shortcoming with the Tags member. The string in my Tags metadata looks like this when editing in Pro: 'BAGIS Tag < Please do not modify: ZUnitCategory|Elevation; ZUnit|Meters; > End Tag, elevation, blah'. When I use the Tags member through the SDK, it returns this: 'BAGIS Tag < Please do not modify: ZUnitCategory|Elevation, ZUnit|Meters, > End Tag'. Obviously not the same content. Instead I am using the getXML member to get all of the metadata and then parsing it with the .NET XML library like I did with ArcMap. I know that I am using some special characters in my tags string but it worked under ArcMap so I have to handle legacy metadata. For anyone else wanting to try this, the XPATH string to get at the Tags element is '/metadata/dataIdInfo/searchKeys/keyword'. Fortunately this did not change between versions. I realize that there is a risk here as ESRI could change the XML schema.
... View more
04-08-2020
10:37 AM
|
1
|
0
|
482
|
POST
|
Thanks for pointing me in the right direction. For anyone wishing to accomplish something similar using the ArcGIS Pro SDK, the following worked for me: // Create a new Stretch Colorizer Definition supplying the color ramp StretchColorizerDefinition stretchColorizerDef = new StretchColorizerDefinition(0, RasterStretchType.DefaultFromSource, 1.0, cimColorRamp); stretchColorizerDef.StretchType = RasterStretchType.PercentMinimumMaximum; //Create a new Stretch colorizer using the colorizer definition created above. CIMRasterStretchColorizer newStretchColorizer = await rasterLayer.CreateColorizerAsync(stretchColorizerDef) as CIMRasterStretchColorizer; if (useCustomMinMax == true) { //Customize min and max newStretchColorizer.StretchType = RasterStretchType.MinimumMaximum; newStretchColorizer.StatsType = RasterStretchStatsType.GlobalStats; StatsHistogram histo = newStretchColorizer.StretchStats; histo.max = stretchMax; histo.min = stretchMin; newStretchColorizer.StretchStats = histo; }
... View more
03-25-2020
03:24 PM
|
1
|
0
|
4381
|
POST
|
I am using the Layer.ReplaceDataSource() to swap out the data source on a raster layer. This is a continuous raster. I also update the raster layer name. However, the legendItem associated with that layer does not completely update. The name changes to the new layer name, but the min and max values for the layer in the legend retain their original values. Is there a way to force this to update?
... View more
03-05-2020
04:44 PM
|
0
|
2
|
462
|
POST
|
Thanks Dan. It turns out that this does work in 2.4.2, but you have to have the uri for the ImageServer exactly right. I added the ImageServer to my project in Pro. When I tried to run the clip tool, I clicked on the folder icon to navigate to the image service that I wanted to use. This is the string that populated the Input Raster field: C:\Users\lbross\Documents\ArcGIS\Projects\MyProject1\arcgis on serverName\DAILY_SWE_NORMALS\daily_swe_normal_apr_01.ImageServer. But apparently the GP tool cannot address the image service in this format. I went back to ArcMap and retrieved the url that had worked previously: http://serverName/arcgis/services/DAILY_SWE_NORMALS/daily_swe_normal_apr_01/ImageServer. When I pasted this into the GP tool, I did not receive an error and the clipping worked! I hope that this works with the Pro SDK which is where I'm actually hoping to use it. As an aside, when you're doing ArcDevelopment, it's not super easy to upgrade to the latest version. I have to keep my add-ins and my Python scripts in sync with what my users are using. These frequent releases of ArcPro will take some getting used to.
... View more
02-28-2020
10:31 AM
|
0
|
0
|
1300
|
POST
|
Is it possible to use the Clip Raster tool with an image service selected as the Input Raster in Pro? I don't want to add it as a map layer first. The tool allows me to select the image service, but then presents errors about it not being a raster/mosaic dataset/layer. I was able to do this using ArcMap. Still using v2.4.2.
... View more
02-27-2020
03:38 PM
|
0
|
2
|
1375
|
POST
|
Thanks Uma. I did as you suggested but now the parent item is always enabled, even if the conditions for all of the child buttons are false. The logical behavior, I think, is to have the parent item disabled unless one or more of the child buttons is enabled.
... View more
01-02-2020
11:32 AM
|
0
|
0
|
460
|
POST
|
I have implemented a button palette in my DAML with two buttons. It seems that the conditions need to be set on the child buttons rather than the parent palette. Condition is not a valid parameter for the buttonPalette XML. If at least one button on the palette is enabled, I would expect the palette to be enabled. However, the opposite appears to be the case. If any of the buttons are disabled, the palette caption/graphic appear to be disabled. The enabled child buttons are still usable. Has anyone else noticed this?
... View more
12-31-2019
02:56 PM
|
0
|
2
|
553
|
POST
|
This is not elegant, but it seems to work. You can use the LayoutElementFactory to create the legend. Then loop through all of the CIMLegendItem(s) in the LegendDefinition. Make an array out of the ones that you want to keep. You can identify them by name. Then set your new array as the CIMLegendItem(s) in the Definition and reset the Definition. This is definitely not as intuitive as it was in ArcObjects: Legend legendElm = LayoutElementFactory.Instance.CreateLegend(layout, leg_env, mapFrame); legendElm.SetName(Constants.MAPS_LEGEND); legendElm.SetAnchor(Anchor.BottomLeftCorner); CIMLegend cimLeg = legendElm.GetDefinition() as CIMLegend; CIMLegendItem[] myLegendItems = new CIMLegendItem[1]; foreach (CIMLegendItem legItem in cimLeg.Items) { if (legItem.Name.Equals(Constants.MAPS_ELEV_ZONE)) { myLegendItems[0] = legItem; break; } } if (myLegendItems[0] != null) { cimLeg.Items = myLegendItems; legendElm.SetDefinition(cimLeg); }
... View more
12-17-2019
03:42 PM
|
0
|
0
|
421
|
POST
|
Uma, I am experiencing the same issue as Gintautas when adding a UniqueValueColorizer to a new raster layer. I am developing on ArcGIS Pro 2.4.2. If I use the VALUE field for the unique values, Pro changes the field name in the TOC to the only text field on the attribute table (NAME) and cannot display the layer. Image of incorrect TOC: If I use the NAME field for the unique values, everything works fine. The code you provided to initialize the colorizer results in the color ramp that I am expecting. It seems that this may have something to do with using the LayerFactory to create the raster layer shortly before symbolizing it. I also tried getting the layer from the map instead of directly from the LayerFactory but this did not change my results. Let me know if I can provide any additional information to help with troubleshooting. Also, for anyone migrating code from ArcObjects, I found that some of the color ramps that were formerly found in the "Default Ramps" style category can be found in the "ArcGIS Colors" style category in Pro. I am working with the "Elevation #2" color ramp.
... View more
12-16-2019
02:51 PM
|
0
|
2
|
406
|
POST
|
Thanks Uma ~ That works! For others trying to do something similar, the ArcGISOnlineConnect project in the samples was the closest to what I was trying to do.
... View more
12-06-2019
01:30 PM
|
0
|
0
|
203
|
Title | Kudos | Posted |
---|---|---|
1 | 07-12-2023 02:45 PM | |
1 | 11-13-2020 10:17 AM | |
1 | 04-08-2020 10:37 AM | |
1 | 03-25-2020 03:24 PM | |
1 | 10-18-2019 02:22 PM |
Online Status |
Offline
|
Date Last Visited |
09-06-2023
07:49 PM
|