|
POST
|
Hi,
Project.OpenAsync returns Task<Project>. So, to assign result of Project.OpenAsync to Project variable, you need to use await before Project.OpenAsync. Your method could look like code below:
public static async Task<Project> GetProject()
{
try
{
string aprxFile = PATH_Aprx_template + "exhibit_map.aprx";
// Open the project
Project project = await Project.OpenAsync(aprxFile);
// Check if the project is null (failed to open)
if (project == null)
{
Console.WriteLine("Failed to open the project.");
return null;
}
return project;
}
catch (Exception ex)
{
Console.WriteLine($"Error in GetProject: {ex.Message}");
return null;
}
}
... View more
11-14-2024
09:16 AM
|
0
|
2
|
3151
|
|
POST
|
Hi,
There is no need to use QueuedTask.Run. GetPlugInWrapper doesn't need MCT thread
protected override void OnClick()
{
// ArcGIS Pro Command's DAML ID.
var commandId = "esri_editing_DivideCommand";
// get the ICommand interface from the ArcGIS Pro Button
// using command's plug-in wrapper
var iCommand = FrameworkApplication.GetPlugInWrapper(commandId) as ICommand;
if (iCommand != null)
{
// Let ArcGIS Pro do the work for us
if (iCommand.CanExecute(null))
{
iCommand.Execute(null);
MessageBox.Show("Any custom code written here executes without waiting for the user to divide a polyline");
}
}
MessageBox.Show("iCommand is done");
}
... View more
11-08-2024
07:10 AM
|
0
|
1
|
2528
|
|
POST
|
Hi,
Declaration of your method must be:
public static Task<long> GetContainedLegOid(FeatureLayer MapMember, Geometry shape, Int64 faid, string startEnd)
Call to you method:
var oid = await GetContainedLegOid(mapMember, shape, faid, startEnd);
It is not good idea to use MessageBox inside QueuedTask.Run. For example, you can return -oid and check value after calling your method:
var oid = await GetContainedLegOid(mapMember, shape, faid, startEnd);
if(oid == 0) {
MessageBox.Show(string.Format("{0} NodeLeg of rdsmall arc with FAID = {1} not found", startEnd, faid));
}
else {
if(oid < 0) {
MessageBox.Show(string.Format("Multiple NodeLegs found, check results"));
oid = -oid;
}
}
... View more
11-07-2024
10:19 PM
|
0
|
0
|
940
|
|
POST
|
Hi,
Try to subscribe to ArcGIS.Desktop.Layouts.Events.LayoutViewEvent and check args.Hint == LayoutViewEventHint.DrawingComplete. LayoutViewEventHint Enumeration here.
... View more
11-07-2024
04:53 AM
|
0
|
0
|
3117
|
|
POST
|
Hi,
There is no difference between the databases you are going to edit from ArcGIS Pro add-in developer side. Take a look at these links: ArcGIS Pro ProConcepts:Editing and video from Esri developer session. It will let you understand editing in ArcGIS Pro SDK.
... View more
11-06-2024
10:20 PM
|
0
|
0
|
770
|
|
POST
|
Hi,
I had similar issue. After some investigation I have found that it couldn't be only distance issue. Sometimes it works on longer paths and doesn't on shorter. I noticed what it could be dependent on restricted paths for walking (highways and etc.) If it is possible to find a way that for example can cross highway but not goes along highway and distance is longer (but not so much) then it creates route. Otherwise it returns exception. So it depends on not only distance but and other network parameters.
... View more
10-31-2024
07:59 AM
|
0
|
0
|
842
|
|
POST
|
I think, you can't select template directly from Create Features pane. But your workflow could be like in sample below:
protected async override void OnClick()
{
await QueuedTask.Run(() =>
{
// Find layer you will work with
var featLayer = MapView.Active.Map.FindLayers("Poly1").First();
// Get all templates and then select template you need or use GetTemplate if you know template name
var editTemplates = featLayer.GetTemplates();
if (editTemplates != null && editTemplates.Count > 0)
{
var editTemplate = editTemplates[0];
// Activate default tool
editTemplate.ActivateDefaultToolAsync();
}
});
}
... View more
10-30-2024
07:44 AM
|
1
|
0
|
2302
|
|
POST
|
Yes. Documentation says that first parameter must be file or folder:
Name
Explanation
Data Type
in_data
[in_data,...]
The folders containing the data files or the data files to convert to geodatabase feature classes.
Folder; File
... View more
10-29-2024
12:10 PM
|
0
|
0
|
3626
|
|
POST
|
Hi,
I think these links could help you: https://community.esri.com/t5/arcgis-pro-sdk-questions/how-to-change-background-color-of-rectangular/m-p/1030564#M6255
https://community.esri.com/t5/arcgis-pro-sdk-questions/trying-to-change-the-fill-color-of-a/m-p/1505192
... View more
10-28-2024
11:39 PM
|
0
|
0
|
1797
|
|
POST
|
Hi,
Change Stackpanel to Grid:
<Grid Grid.Row="1">
<ContentPresenter Content="{Binding CurrentPage}"></ContentPresenter>
</Grid>
Stackpanel has some limitations
... View more
10-28-2024
08:29 AM
|
0
|
0
|
1482
|
|
POST
|
Hi,
Use GetPlugInWrapper Method—ArcGIS Pro. To find tool reference id move mouse over the tool.
... View more
10-28-2024
08:14 AM
|
1
|
3
|
2327
|
|
POST
|
Hi,
MapTool has possibility to output sketch coordinates in map or screen. Look at ScreenCoordsToMapPoint sample
... View more
10-26-2024
11:30 AM
|
1
|
0
|
885
|
|
POST
|
Link is above. This is python sample at the bottom of page. There is no documentation for each geoprocessing tool for ArcGIS Pro SDK for .NET.
... View more
10-26-2024
11:24 AM
|
0
|
2
|
3787
|
|
POST
|
Hi,
Look at the BackStage_PropertyPage sample. Open ProjectSettingsViewModel.cs file. Look inside InitializeAsync() and CommitAsync() methods how you can access and modify project settings. If you need to save changes right now, you can call :
await Project.Current.SaveAsync();
... View more
10-24-2024
04:02 AM
|
0
|
0
|
3296
|
|
POST
|
Seems like correct workflow.
P.s. Don't forget to set SelectNewFeatures flag of EditOperation to true. Only your new feature will be selected after merge execution and you can take new objectid from selection for shape copying
... View more
10-24-2024
03:21 AM
|
0
|
2
|
2570
|
| Title | Kudos | Posted |
|---|---|---|
| 1 | 3 weeks ago | |
| 1 | 3 weeks ago | |
| 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 |
2 weeks ago
|