|
POST
|
Code below works: internal class Button1 : Button
{
protected async override void OnClick()
{
var layers = MapView.Active.Map.GetLayersAsFlattenedList();
foreach(var layer in layers) {
await RecurseTocLayers(layer);
}
}
private async Task RecurseTocLayers(Layer layer)
{
if (layer is BasicFeatureLayer)
{
FeatureLayer featureLayer = layer as FeatureLayer;
//THIS ONLY GETS CALLED ONCE - THEN NEVER AGAIN!
await QueuedTask.Run(() =>
{
var table = featureLayer.GetTable();
TableDefinition tableDefinition = table.GetDefinition();
string alias = tableDefinition.GetAliasName();
//do something here with alias name.....e.g.
System.Diagnostics.Debug.WriteLine($"The alias name is: {alias}");
});
}
if (layer is GroupLayer)
{
//do something here with GroupLayer, then....
GroupLayer groupLayer = (GroupLayer)layer;
foreach (var child in groupLayer.Layers)
{
await RecurseTocLayers(child);
}
}
}
}
... View more
11-14-2022
01:46 AM
|
0
|
3
|
2217
|
|
POST
|
Hi, Code you pasted has a different count of opening and closing brackets, but it works fine. Could you please share code you read layers list from TOC?
... View more
11-13-2022
10:24 PM
|
0
|
5
|
2230
|
|
POST
|
Hi all, We are facing the same issue with ArcGIS Pro 3.0.2. What about you?
... View more
11-11-2022
04:01 AM
|
0
|
1
|
662
|
|
POST
|
Hi, Are you going to read attributes of loaded feature? If yes, then you can do it like this: var value = inspector[fieldName];
... View more
11-09-2022
06:59 AM
|
2
|
1
|
1712
|
|
POST
|
Hi, EditEvents sample shows how to unsubscribe from editEvents
... View more
11-07-2022
06:59 AM
|
2
|
0
|
1025
|
|
POST
|
On Closed event it destroys objects. I don't use that pattern. You can use local variable like this: protected override void OnClick()
{
CreateLotWindow createlotwindow = new CreateLotWindow();
createlotwindow.Owner = FrameworkApplication.Current.MainWindow;
if(createlotwindow.ShowDialog()== true) {
var viewModel = createlotWindow.DataContext as CreateLotWindowViewModel;
var count = viewModel.LotCount;
}
}
... View more
11-04-2022
08:50 AM
|
1
|
1
|
1966
|
|
POST
|
Hi, You can read it from computer registry: Code to read value: RegistryKey registryKey = Registry.LocalMachine.OpenSubKey(@"SOFTWARE\ESRI\ArcGISPro");
object activeEnv = registryKey.GetValue("PythonCondaEnv");
object envPath = registryKey.GetValue("PythonCondaRoot");
... View more
11-04-2022
02:51 AM
|
1
|
1
|
1641
|
|
POST
|
Hi, You can use DataContext to access view model properties: protected override void OnClick()
{
if (_createlotwindow != null)
return;
_createlotwindow = new CreateLotWindow();
_createlotwindow.Owner = FrameworkApplication.Current.MainWindow;
_createlotwindow.Closed += (o, e) => { _createlotwindow = null; };
if(_createlotwindow.ShowDialog()== true) {
var viewModel = _createlotWindow.DataContext as CreateLotWindowViewModel;
var count = viewModel.LotCount;
}
}
... View more
11-03-2022
11:32 PM
|
2
|
3
|
1985
|
|
POST
|
Yes, I have tried. It does not work on shapefile but works with gdb table. I have tried to change field name. alias name and length of TEXT field. There is some limitation with field type changing Have you checked what you get from oGeodatabase.GetPath().LocalPath ?
... View more
10-28-2022
06:57 AM
|
0
|
1
|
2173
|
|
POST
|
Hi, Maybe this link will help you: https://community.esri.com/t5/arcobjects-sdk-questions/does-arcobjects-works-with-arcgis-10-9-and-above/m-p/1161513
... View more
10-28-2022
03:07 AM
|
0
|
0
|
2107
|
|
POST
|
Hi, You have wrong parameters list. TableName and geodatabase path must be combined together: var parameters = Geoprocessing.MakeValueArray(Path.Combine(oGeodatabase.GetPath().AbsolutePath, sTableName), sFieldName, sNewFieldName, sNewAlias, "TEXT");
var gpResult = Geoprocessing.ExecuteToolAsync("management.AlterField", parameters, null, CancelableProgressor.None, GPExecuteToolFlags.None); You can change field type if the input table is empty (does not contain records)
... View more
10-27-2022
10:27 PM
|
1
|
3
|
2189
|
|
POST
|
Hi, You can call the same geoprocessing tools from ArcGIS Pro SDK: var parameters = Geoprocessing.MakeValueArray(gdb, domName, code, domDict[code]);
var gpResult = Geoprocessing.ExecuteToolAsync("management.AddCodedValueToDomain", parameters,
null, CancelableProgressor.None, GPExecuteToolFlags.None);
... View more
10-26-2022
02:41 AM
|
1
|
2
|
3526
|
|
POST
|
I have accepted Community Terms of Use. One of them is "no advertising"
... View more
10-20-2022
01:41 AM
|
0
|
1
|
2534
|
|
POST
|
Hi, My code is a little bit different and it works on ArcGIS Pro 9.2 var poly_symbol = SymbolFactory.Instance.ConstructPolygonSymbol(CIMColor.CreateRGBColor(130, 130, 130, 40));
var graphic = new CIMPolygonGraphic()
{
Symbol = poly_symbol.MakeSymbolReference(),
Polygon = box
};
graphic.Name = "ExtentSelection";
displayLayer.AddElement(graphic); It seems that CIMPolygonGraphic constructor overrides Name you set
... View more
10-19-2022
12:05 PM
|
1
|
0
|
1071
|
|
POST
|
Sorry. It is a commercial software licensing product.
... View more
10-19-2022
11:58 AM
|
0
|
3
|
2546
|
| Title | Kudos | Posted |
|---|---|---|
| 1 | 2 weeks ago | |
| 1 | 2 weeks ago | |
| 2 | 04-24-2026 08:33 AM | |
| 1 | 03-23-2026 11:44 AM | |
| 1 | 05-22-2024 11:48 PM |
| Online Status |
Offline
|
| Date Last Visited |
Wednesday
|