|
POST
|
Hi, This is what I did - In the zip file there was a prediction.lyr file. At this point in 2.4, the new methods to apply symbology using the layer definitions from a .lyr doesn't work with 2.4. This will hopefully be fixed soon. I added the prediction.lyr to Pro, fixed the data source by pointing to the grid layer you sent. I then saved it as a lyrx file. I have attached this lyrx file as FS-Prediction.lyrx. This lyrx file had a CIMRasterClassifyColorizer. I then used the code below to apply the symbology from FS-Prediction.lyrx to the grid you sent and it worked for me. Note: the lyrx was not loaded in Pro when I did this. protected override async void OnClick()
{
var lyrs = MapView.Active.Map.GetLayersAsFlattenedList().OfType<RasterLayer>();
await ModifyLayerSymbologyFromLyrFileAsync(lyrs, @"C:\Users\uma2526\Documents\ArcGIS\Projects\RasterColorizer\FS-Prediction.lyrx");
}
private static async Task ModifyLayerSymbologyFromLyrFileAsync(IEnumerable<RasterLayer> featureLayers, string layerFile)
{
await QueuedTask.Run(() =>
{
foreach (var featureLayer in featureLayers)
{
//Get the Layer Document from the lyrx file
var lyrDocFromLyrxFile = new LayerDocument(layerFile);
var cimLyrDoc = lyrDocFromLyrxFile.GetCIMLayerDocument();
//Get the renderer from the layer file
//This lyr file has a unique value renderer.
var rendererFromLayerFile = ((CIMRasterLayer)cimLyrDoc.LayerDefinitions[0]).Colorizer as CIMRasterClassifyColorizer;
//Apply the renderer to the feature layer
featureLayer?.SetColorizer(rendererFromLayerFile);
}
});
} Please let me know if this is similar to the workflow you are want. Thanks Uma
... View more
07-11-2019
08:46 AM
|
0
|
3
|
3317
|
|
POST
|
Hi Tim, You will need to create a Pro Dockpane for this. There are a few examples in the community samples that illustrate this. The Create Sample uses layers and field selection in a dockpane: Thanks Uma
... View more
07-10-2019
08:13 AM
|
1
|
1
|
1649
|
|
POST
|
Hi Yes, please do send it - I can check it out to see what is happening. Thanks Uma
... View more
07-10-2019
08:05 AM
|
0
|
5
|
3317
|
|
POST
|
Hi I see the same issue with the old lyr file - I have informed the developer about this. I will let you know when this gets addressed. With lyrx files, I was able to apply the symbology with the "Classify" colorizer - I did not load the lyrx file. Can you please explain the issues you are having? Thanks Uma
... View more
07-09-2019
11:22 AM
|
0
|
7
|
3317
|
|
POST
|
Hi Jan, At 2.3, there was a bug with the custom drop handler that caused this error. This has been fixed in 2.4. Thanks Uma
... View more
07-08-2019
09:58 AM
|
0
|
0
|
783
|
|
POST
|
Hi Gintautas Here is a code snippet for using this pattern with Raster layers. Raster use the Colorizer - Get/SetColorizer. private static async Task ModifyLayerSymbologyFromLyrFileAsync(IEnumerable<RasterLayer> featureLayers, string layerFile)
{
await QueuedTask.Run(() =>
{
foreach (var featureLayer in featureLayers)
{
//Get the Layer Document from the lyrx file
var lyrDocFromLyrxFile = new LayerDocument(layerFile);
var cimLyrDoc = lyrDocFromLyrxFile.GetCIMLayerDocument();
//Get the renderer from the layer file
//This lyr file has a unique value renderer.
var rendererFromLayerFile = ((CIMRasterLayer)cimLyrDoc.LayerDefinitions[0]).Colorizer as CIMRasterUniqueValueColorizer;
//Apply the renderer to the feature layer
featureLayer?.SetColorizer(rendererFromLayerFile);
}
});
} Thanks Uma
... View more
07-08-2019
09:57 AM
|
0
|
1
|
2920
|
|
POST
|
Hi, A new method has been added to Pro 2.4 to allow you to lookup symbols. Symbol lookup Thanks Uma
... View more
06-26-2019
10:04 AM
|
0
|
0
|
963
|
|
POST
|
Hi With the 2.4 release, SignAddIn.zip is now available to download from the Assets section: https://github.com/Esri/arcgis-pro-sdk/releases/tag/2.4.0.19948 Extract the contents to your build server to sign the add-in without Pro installed. Thanks Uma
... View more
06-26-2019
10:02 AM
|
0
|
2
|
2994
|
|
POST
|
Hi There is a new method available with Pro 2.4 that will allow you to do this: FeatureLayer.IsVisibleInView(MapView) ProSnippet: Check if Layer is visible in the given map view Thanks Uma
... View more
06-26-2019
10:00 AM
|
0
|
0
|
956
|
|
POST
|
Hi Bryan, There are no problems including 3rd party controls in the Pro Add-ins. There are a few samples we provide that do this with no issues - WPF Extended tool kit used here: ConstructMarkerFromFont Avalon: Styling-with-ArcGIS-Pro Thanks Uma
... View more
06-25-2019
03:42 PM
|
1
|
0
|
870
|
|
POST
|
Hi Bryan Check out this Pro SDK Community sample: LayersPane In this sample, the text in the search text box is passed as a "parameter" to the Search ICommand. Thanks Uma
... View more
06-25-2019
03:37 PM
|
0
|
0
|
1423
|
|
POST
|
Hi No problem. You will just have to use the C# RegistryKey class to get the Pro version registry key in code. And then you can display the Version in the splash screen.. A code similar to this can be used to get the Pro's version registry key. RegistryKey localKey = egistryKey.OpenBaseKey(Microsoft.Win32.RegistryHive.LocalMachine, RegistryView.Registry64);
RegistryKey esriKey = localKey.OpenSubKey(@"SOFTWARE\ESRI\ArcGISPro");
if (esriKey == null)
{
localKey = RegistryKey.OpenBaseKey(Microsoft.Win32.RegistryHive.CurrentUser, RegistryView.Registry64);
esriKey = localKey.OpenSubKey(@"SOFTWARE\ESRI\ArcGISPro");
}
if (esriKey == null)
{
//this is an error
MessageBox.Show("Pro is not installed");
}
var version = esriKey.GetValue("Version") as string;
if (version == null || version == string.Empty)
//this is an error
MessageBox.Show("Pro is not installed");
return version;
... View more
06-25-2019
02:31 PM
|
1
|
1
|
3974
|
|
POST
|
Hi Dylan The best way to get the Pro version to display on your Configuration's splash screen is to use the registry. Pro's version is provided in the following key: [HKEY_LOCAL_MACHINE\SOFTWARE\ESRI\ArcGISPro]
"InstallDir"="C:\\Program Files\\ArcGIS\\Pro\\"
...
"Version"="2.4"
Please note, Pro can be installed without admin rights - which means these keys could be found in the HKEY_CURRENT_USER registry hive if Pro was installed in the context of a single user. Thanks Uma
... View more
06-25-2019
01:48 PM
|
0
|
3
|
3974
|
|
POST
|
WPF Spark Nuget provides a "FluidProgressBar" user control that can be used for this. * Download the WPF Spark nuget * Include the user control in your splash screen in the configuration project. <Grid>
<Border BorderBrush="Black" BorderThickness="3" Margin="10">
<Grid>
<Grid.RowDefinitions>
...
<TextBlock ...>
ProgressDots
</TextBlock>
<wpfspark:FluidProgressBar Grid.Row="1" Margin="50, 50">
</wpfspark:FluidProgressBar>
</Grid>
</Border>
</Grid> Thanks Uma
... View more
06-25-2019
11:22 AM
|
2
|
0
|
3974
|
|
POST
|
Hi Brian Pro 2.4 allows you to apply symbology from a layer file using the Pro .NET API. A new LayerDocument class at 2.4 provides this functionality. Pro 2.4 will be released this week. Using Pro 2.4, the snippet below will apply symbology from a lyr file to a feature layer in the TOC. private static async Task ModifyLayerSymbologyFromLyrFileAsync(IEnumerable<FeatureLayer> featureLayers, string layerFile)
{
await QueuedTask.Run( () => {
foreach (var featureLayer in featureLayers)
{
//Get the Layer Document from the lyrx file
var lyrDocFromLyrxFile = new LayerDocument(layerFile);
var cimLyrDoc = lyrDocFromLyrxFile.GetCIMLayerDocument();
//Get the renderer from the layer file
//This lyr file has a unique value renderer.
var rendererFromLayerFile = ((CIMFeatureLayer)cimLyrDoc.LayerDefinitions[0]).Renderer as CIMUniqueValueRenderer;
//Apply the renderer to the feature layer
featureLayer?.SetRenderer(rendererFromLayerFile);
}
});
} Thanks Uma
... View more
06-24-2019
01:04 PM
|
2
|
9
|
6586
|
| Title | Kudos | Posted |
|---|---|---|
| 1 | 04-14-2026 09:54 AM | |
| 1 | 01-21-2026 10:48 AM | |
| 1 | 09-18-2025 03:09 PM | |
| 1 | 11-04-2025 08:25 AM | |
| 1 | 09-23-2025 09:31 AM |
| Online Status |
Offline
|
| Date Last Visited |
04-16-2026
09:00 AM
|