|
POST
|
Hi, Active layout must be selected before executing code below: protected override void OnClick()
{
var command = FrameworkApplication.GetPlugInWrapper("esri_sharing_ExportLayout") as ICommand;
if (command.CanExecute(null))
command.Execute(null);
}
... View more
10-24-2025
10:51 AM
|
1
|
0
|
189
|
|
POST
|
There is no possibility to have map layer not added to map. You can use Copy Features GP tool and as an output use memory workspace //get the active map
MapView activeView = MapView.Active;
//get the first layer in the active map
var layer = activeView.Map.GetLayersAsFlattenedList().OfType<FeatureLayer>().First();
if(layer == null)
return;
var parameters = Geoprocessing.MakeValueArray(layer, @"memory\clonedFC");
IGPResult result = await Geoprocessing.ExecuteToolAsync("CopyFeatures_management", parameters, null, null, null, GPExecuteToolFlags.AddToHistory);
... View more
10-20-2025
11:40 PM
|
0
|
3
|
525
|
|
POST
|
Hi, You can use EditOperation Copy method. Below is code for map selection copy layer by layer: var mv = MapView.Active;
return QueuedTask.Run(() =>
{
var sel_set = mv.Map.GetSelection().ToDictionary();
if (sel_set.Count() == 0)
return false;
//do the copy
var editOp = new EditOperation()
{
Name = "Copy",
ErrorMessage = "Copy failed"
};
foreach (var kvp in sel_set)
{
editOp.Copy(kvp.Key, kvp.Key, kvp.Value);
}
return editOp.Execute();
});
... View more
10-20-2025
11:28 AM
|
0
|
0
|
548
|
|
POST
|
That's bad. You need return your list from MCT thread and then set property in UI thread. var locationList = await QueuedTask.Run(() =>
{
var locationList = new ObservableCollection<OffroadLocationNames>();
if (!string.IsNullOrEmpty(pointData.TrafficFeature) && pointData.LocationID > 0)
{
OffroadLocationNames thisOne = Module1.Current.Cache.OffroadLocations.Data.FirstOrDefault(d => d.LocationId == pointData.LocationID);
if (thisOne != null)
{
locationList.Add(thisOne);
locationList.Add(new OffroadLocationNames() { LocationId = -1, LocationName = "" });
}
locationList.AddRange(Module1.Current.Cache.OffroadLocations.GetUnusedLocationNames(pointData.TrafficFeature));
return locationList;
});
LocationNames = new ObservableCollection<OffroadLocationNames>(locationList);
SelectedLocationName = LocationNames.First(); // OrDefault(ln => ln.LocationId == thisOne.LocationId); or var locationList = new ObservableCollection<OffroadLocationNames>();
if (!string.IsNullOrEmpty(pointData.TrafficFeature) && pointData.LocationID > 0)
{
OffroadLocationNames thisOne = Module1.Current.Cache.OffroadLocations.Data.FirstOrDefault(d => d.LocationId == pointData.LocationID);
if (thisOne != null)
{
locationList.Add(thisOne);
locationList.Add(new OffroadLocationNames() { LocationId = -1, LocationName = "" });
}
locationList.AddRange(Module1.Current.Cache.OffroadLocations.GetUnusedLocationNames(pointData.TrafficFeature));
RunOnUIThread(() =>
{
LocationNames = new ObservableCollection<OffroadLocationNames>(locationList);
SelectedLocationName = LocationNames.First(); // OrDefault(ln => ln.LocationId == thisOne.LocationId);
});
}
/// <summary>
/// utility function to enable an action to run on the UI thread (if not already)
/// </summary>
/// <param name="action">the action to execute</param>
/// <returns></returns>
internal static Task RunOnUIThread(Action action)
{
if (OnUIThread)
{
action();
return Task.FromResult(0);
}
else
return Task.Factory.StartNew(action, System.Threading.CancellationToken.None, TaskCreationOptions.None, QueuedTask.UIScheduler);
} Sorry for code formating
... View more
10-15-2025
09:20 AM
|
1
|
2
|
504
|
|
POST
|
From what thread are you trying to update properties: MCT or UI?
... View more
10-15-2025
08:22 AM
|
0
|
4
|
510
|
|
POST
|
Hi, Your properties set methods doesn't initiate NotifyPropertyChanged event. Your dockpane binding properties must look in code below: private ObservableCollection<OffroadLocationNames> _locationNames;
public ObservableCollection<OffroadLocationNames> LocationNames
{
get => _locationNames;
set => SetProperty(ref _locationNames, value, () => LocationNames);
}
private OffroadLocationNames _selectedLocationName;
public OffroadLocationNames SelectedLocationName
{
get => _selectedLocationName;
set => SetProperty(ref _selectedLocationName, value, () => SelectedLocationName);
}
... View more
10-15-2025
06:26 AM
|
0
|
1
|
528
|
|
POST
|
Hi, Have you copied application from bin\release or used published content? You need to publish application from Visual Studio. Right click on project and select Publish menu item. Define publishing folder. After publishing copy publishing folder content. On other PC on startup you will be asked to download and install .NET version used in your application if it doesn't exist.
... View more
10-14-2025
10:22 PM
|
0
|
0
|
449
|
|
POST
|
Hi, I would recommend to use ExecuteToolAsync method with GPToolExecuteEventHandler parameter . More info you could find in another thread. It will allow you to get more information about input/output parameters validity. Another one thing is your where clause. If you check your where clause in ArcGIS Pro Select By Attributes tool, you will find what query for date fields needs timestamp. Your query could be like this: "valid_to = timestamp '2019-01-01 00:00:00' and CATEG IS NOT NULL" Info here
... View more
10-06-2025
11:07 AM
|
0
|
0
|
217
|
|
POST
|
Hi, ArcGIS Pro SDK supports building stand alone applications using ArcGIS.CoreHost and ArcGIS.Core assemblies. More info on this wiki: ProConcepts: Core Host Now is ChatGPT time, Google is yesterday 🙂
... View more
10-06-2025
12:46 AM
|
1
|
0
|
241
|
|
POST
|
Hi, Your code will modify only last feature. To modify all features code must look like: EditOperation editOperation = new() { Name = editOperationName, ProgressMessage = "Modifying features ...", ShowProgressor = true };
Inspector inspector = new();
using (RowCursor cursor = featureClass.Search(new() { WhereClause = "<my whereclause>" }))
{
if (cursor.MoveNext())
{
Row row = cursor.Current;
inspector.Load(row);
inspector["myattribute"] = < any different value>;
editOperation.Modify(inspector);
}
}
_ = editOperation.Execute();
... View more
09-24-2025
08:30 AM
|
0
|
0
|
242
|
|
POST
|
Hi, As was described in your link, change of Image in daml will change image of your AddIn in Add In Manager of ArcGIS Pro. You need WPF way to change window icon. Add *.ico file to your AddIn resources and set build Action to "Resource" Open your ProWindow xaml and set Icon property: <controls:ProWindow x:Class="DockpaneSimple.ProWindow1"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:controls="clr-namespace:ArcGIS.Desktop.Framework.Controls;assembly=ArcGIS.Desktop.Framework"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:extensions="clr-namespace:ArcGIS.Desktop.Extensions;assembly=ArcGIS.Desktop.Extensions"
mc:Ignorable="d"
Title="ProWindow1" Height="300" Width="300"
Icon="resources\appicon.ico"
WindowStartupLocation="CenterOwner"
> And you will get:
... View more
09-24-2025
12:59 AM
|
1
|
0
|
356
|
|
POST
|
XAML: <ComboBox ItemsSource="{Binding GeometryTypes}" SelectedItem="{Binding SelectedGeometryType, Mode=TwoWay}" Text="Select Option" /> ViewModel: public List<string> GeometryTypes => new List<string>() { "Polygon", "Polyline", "Point" };
public string SelectedGeometryType { get; set; } = "Polygon";
... View more
09-16-2025
10:14 PM
|
0
|
0
|
600
|
|
POST
|
Hi, You can do it from xaml: <ComboBox Height="23" Name="comboBox1" Width="120">
<ComboBoxItem Content="Polygon"/>
<ComboBoxItem Content="Polyline"/>
<ComboBoxItem Content="Point"/>
</ComboBox>
... View more
09-16-2025
10:38 AM
|
0
|
0
|
620
|
| Title | Kudos | Posted |
|---|---|---|
| 1 | Tuesday | |
| 2 | 2 weeks ago | |
| 1 | 10-24-2025 10:51 AM | |
| 1 | 10-15-2025 09:20 AM | |
| 1 | 10-06-2025 12:46 AM |
| Online Status |
Online
|
| Date Last Visited |
an hour ago
|