|
POST
|
Hi, You can look at ArcGIS Pro Snippets: https://github.com/Esri/arcgis-pro-sdk/wiki/ProSnippets-TextSymbols https://github.com/Esri/arcgis-pro-sdk/wiki/ProSnippets-Labeling private static Task<CIMTextSymbol> CreateSimpleTextAsync()
{
return QueuedTask.Run <CIMTextSymbol>(() =>
{
//Create a simple text symbol
return SymbolFactory.Instance.ConstructTextSymbol(ColorFactory.Instance.BlackRGB, 8.5, "Corbel", "Regular");
});
}
//Note: call within QueuedTask.Run()
//Get the layer's definition
var lyrDefn = featureLayer.GetDefinition() as CIMFeatureLayer;
//Get the label classes - we need the first one
var listLabelClasses = lyrDefn.LabelClasses.ToList();
var theLabelClass = listLabelClasses.FirstOrDefault();
//Set the label classes' symbol to the custom text symbol
//Refer to the ProSnippets-TextSymbols wiki page for help with creating custom text symbols.
var textSymbol = await CreateSimpleTextAsync();
theLabelClass.TextSymbol.Symbol = textSymbol;
lyrDefn.LabelClasses = listLabelClasses.ToArray(); //Set the labelClasses back
featureLayer.SetDefinition(lyrDefn); //set the layer's definition
//set the label's visiblity
featureLayer.SetLabelVisibility(true); P.s. Sample for one class, but you can create classes for each attribute value combination
... View more
01-11-2022
04:02 AM
|
0
|
6
|
3681
|
|
POST
|
Hi, Have you tried like this: string statisticsFields = "Shape_Length SUM;Shape_Area SUM";
var parameters = Geoprocessing.MakeValueArray(shpLayer, file, dissolveFields, statisticsFields, "MULTI_PART", "DISSOLVE_LINES");
var gpResult = Geoprocessing.ExecuteToolAsync("Dissolve_management", parameters, null, CancelableProgressor.None, GPExecuteToolFlags.None);
... View more
01-10-2022
10:29 PM
|
1
|
1
|
2774
|
|
POST
|
Hi, I would recommend to execute the same tool from ArcGIS Pro Geoprocessing pane. Then copy python script and check, how parameters looks in python script. For .NET there is no better way to get geoprocessing function parameters. Using Geoprocessing.MakeValueArray try to get the same or similar.
... View more
01-10-2022
06:55 AM
|
0
|
3
|
2794
|
|
POST
|
Hi, I have attached one of your mentioned CustomCatalog project files. You can put it on top of existing file and check it is what you want. To create new panel use dockpane burger button menu item. GintautasKmieliauskas_0-1641567174275.png Fell free to ask if something is unclear.
... View more
01-07-2022
06:53 AM
|
0
|
1
|
2424
|
|
POST
|
Hi, Use method SetName of Layer object. layer.SetName("New layer name");
... View more
01-06-2022
11:11 PM
|
1
|
0
|
1114
|
|
POST
|
Hi, CalculateField_management has optional parameter for Field Type specifying. Try to specify Short because python by default has only int. So its too big for your field and needs to convert it.
... View more
01-06-2022
11:02 PM
|
0
|
0
|
1866
|
|
POST
|
Hi, Try this code: with arcpy.da.UpdateCursor(fc1,flds) as upd_cur:
for upd_row in upd_cur:
updated = False
if upd_row[1] == None:
upd_row[1] = upd_row[0]
updated = True
if upd_row[0] == None:
upd_row[0] = upd_row[1]
updated = True
if updated == True:
upd_cur.updateRow(upd_row) To speed up process you can add whereclause parameter to your UpdateCursor to check is one of fields is None or empty
... View more
01-05-2022
10:36 PM
|
1
|
2
|
1725
|
|
POST
|
Sorry, I have not checked existing of parameters. Have you checked like this: List<KeyValuePair<string, string>> env1 = new List<KeyValuePair<string, string>>();
env1.Add(new KeyValuePair<string, string>("maintainAttachments", "True"));
env1.Add(new KeyValuePair<string, string>("preserveGlobalIds", "True")); If you have to set other parameters, you can cast MakeEnvironmentArray result to List and then add additional values.
... View more
01-03-2022
12:12 AM
|
0
|
0
|
2050
|
|
POST
|
Hi, You can draw some features on map using AddOverlayAsync method . Sample is here: https://github.com/Esri/arcgis-pro-sdk-community-samples/tree/master/Map-Exploration/OverlayExamples
... View more
01-02-2022
01:41 AM
|
0
|
0
|
3353
|
|
POST
|
Hi, You can set them like that: var env = Geoprocessing.MakeEnvironmentArray(maintainAttachments: "True",
preserveGlobalIds: "True"); Name for each setting you can find here: https://pro.arcgis.com/en/pro-app/latest/tool-reference/environment-settings/an-overview-of-geoprocessing-environment-settings.htm
... View more
01-02-2022
01:23 AM
|
0
|
2
|
2058
|
|
POST
|
Hi, Have you tried this (best-way-to-show-progress) using Dispatcher?
... View more
12-30-2021
02:03 AM
|
0
|
1
|
1021
|
|
POST
|
Hi, You can call python script from ArcGIS Pro add-in. More info here: https://developers.arcgis.com/documentation/arcgis-add-ins-and-automation/arcgis-pro/tutorials/analysis-with-python/ I think there is no possibility to call add-in from python. From python you can call ArcGIS Pro CoreHost application. How to create feature from ArcGIS Pro add-in you can find here: https://github.com/Esri/arcgis-pro-sdk/wiki/ProSnippets-Editing If you create feature using feature layer, it will be automatically shown on map.
... View more
12-29-2021
12:38 AM
|
0
|
2
|
3383
|
|
POST
|
Hi, Your code is fine. But compiler thinks that there is one situation when your method AddLayerToTOC could return unassigned fLayer value. For example if your foreach cycle will not be executed. This is compiler problem, not yours. And workaround for this is to preassign fLayer value with null in line 7.
... View more
12-23-2021
08:35 AM
|
1
|
1
|
2408
|
|
POST
|
Hi, It is simple. Set it to null: FeatureLayer fLayer = null;
... View more
12-22-2021
10:08 PM
|
0
|
3
|
2414
|
|
POST
|
Hi, I try to write regression tests for my ArcGIS Pro code. Some code contains EditOperation object functionality. My code for ArcGIS Pro add-in works fine, but when I run the same code with same input data from unit test EditOperation ExecuteAsync return false. Is it impossible to write test for EditOperation or there is some magic to do that?
... View more
12-22-2021
03:23 AM
|
0
|
1
|
864
|
| Title | Kudos | Posted |
|---|---|---|
| 1 | a month ago | |
| 1 | 07-21-2026 10:23 PM | |
| 1 | 06-30-2026 10:14 PM | |
| 1 | 06-30-2026 01:43 PM | |
| 2 | 04-24-2026 08:33 AM |
| Online Status |
Offline
|
| Date Last Visited |
Monday
|