|
POST
|
You can specify 2.9.buildno in config.daml in the AddInInfo tag's desktopVersion attribute. To find the buildno for 2.9.5 you can look in your control panel under programs / features. The screen shot below is the version number desktopVersion number for 3.0. You can also create a new add-in with ArcGIS Pro 2.9.5 installed which will fill in the minimum desktopVersion for 2.9.5 in your config.daml. See here: ProConcepts Advanced Topics · Esri/arcgis-pro-sdk Wiki (github.com)
... View more
11-09-2022
09:07 AM
|
0
|
3
|
1933
|
|
POST
|
Try this: <groups>
<!-- comment this out if you have no controls on the Addin tab to avoid
an empty group-->
<group id="TestEditUndoButton_Group1" caption="Add Undo button" appearsOnAddInTab="true">
<!-- host controls within groups -->
<splitButton refID="esri_core_undoSplitButton" size="small"/>
</group>
</groups> You can find all undo associated daml ids here: DAML ID Reference ADCore.daml · Esri/arcgis-pro-sdk Wiki (github.com)
... View more
11-04-2022
07:00 AM
|
1
|
0
|
643
|
|
POST
|
To support ArcGIS Pro 2.9 you need to install and use Visual Studio 2019. Follow these steps to resolve the assembly path issue: FAQ · Esri/arcgis-pro-sdk Wiki (github.com)
... View more
11-03-2022
02:44 PM
|
0
|
1
|
1898
|
|
POST
|
There are two issues i can see here: 1) When you use: 'var deleteOperation = args.Operation;' meaning you try to use the existing (executing) EditOperation, you cannot include a table or feature class that is not already on the map (table of content) during that edit session. In other words, you can only include tables and feature classes that are part of your map in your editoparation in order to make any changes part of an undo/redo operation. 2) You should not open a new database connection each time you delete a record. The database connection should be established once in your session for various reasons. If you really can't include the standalone table in your TOC you should still adhere to my 2. point above and try to create the database connection only once and then use Table.DeleteRows (QueryFilter) (DeleteRows Method—ArcGIS Pro) to delete the related rows.
... View more
11-03-2022
02:29 PM
|
1
|
0
|
1702
|
|
POST
|
Unfortunately, the XAML designer (which is part of VS 2022) is somehow not able to find the ArcGIS Pro assemblies referenced in the XAML. You see these errors only when the XAML designer is open. When you close the XAML designer, the errors go away, and the application is able to find and load all required assemblies. I will check once more with the framework dev team to see if there's a workaround for this VS issue.
... View more
11-01-2022
02:58 PM
|
0
|
1
|
3180
|
|
POST
|
Actually, after i tried your use case with my code snippet again i realized that my dataset didn't really represent the one-to-many (related records) use case property, instead with my data i always only had one related record that was correctly deleted. After changing my query logic, i was able to duplicate the same problem that you are seeing. I think that this is actually a bug. I will pass this on to the Editor team. However, there is a workaround for this issue. You can use the EditOperation Delete method on the table instead of deleting each row. The following code snippet worked for me: // collect all object ids that need to be deleted
List<long> ids = new List<long>();
using (var tableCursor = _countyTable.Search(qf))
{
while (tableCursor.MoveNext())
{
using (var tableRow = tableCursor.Current)
{
//not working as expected: deleteEditOp.Delete(tableRow);
ids.Add(tableRow.GetObjectID());
}
}
}
// delete all records with objects ids
deleteEditOp.Delete(_countyTable, ids); Can you check if this works for you?
... View more
10-31-2022
12:29 PM
|
1
|
2
|
4172
|
|
POST
|
So you see the "Objectid: ..." output for multiple records but only the last record is being deleted? I have implemented the same scenario also with a one-to-many relationship and all my related records are deleted. Which release of ArcGIS Pro are you using?
... View more
10-31-2022
10:03 AM
|
0
|
1
|
1724
|
|
POST
|
In addition to Charlie's answer there is also a arcpy toolbox sample available here: arcgis-pro-sdk-community-samples/Geoprocessing at master · Esri/arcgis-pro-sdk-community-samples (github.com) This sample will add a toolbox with the py script to ArcGIS Pro: I modified the sample and added a button that will call the py script in the toolbox from .NET: I attached the sample solution.
... View more
10-28-2022
03:01 PM
|
0
|
2
|
1606
|
|
POST
|
Or you can use the Symbol's OffsetX and OffsetY to distance the two graphic elements. This is my code snippet: internal class PlaceDoubleText : MapTool
{
private CIMTextSymbol _callout1TextSymbol = null;
private CIMTextSymbol _callout2TextSymbol = null;
private GraphicsLayer _selectedGraphicLayer = null;
public PlaceDoubleText()
{
IsSketchTool = true;
SketchType = SketchGeometryType.Point;
SketchOutputMode = SketchOutputMode.Map;
}
protected override async Task OnToolActivateAsync(bool active)
{
_callout1TextSymbol = await CreateBalloonCalloutAsync();
_callout2TextSymbol = await CreateBalloonCalloutAsync();
_callout2TextSymbol.OffsetY = 26;
_selectedGraphicLayer = MapView.Active.Map.GetLayersAsFlattenedList().OfType<GraphicsLayer>().FirstOrDefault();
return;
}
protected override Task<bool> OnSketchCompleteAsync(Geometry geometry)
{
if (_selectedGraphicLayer == null)
{
MessageBox.Show("Add a graphics layer to the TOC", "No graphics layer found",
System.Windows.MessageBoxButton.OK, System.Windows.MessageBoxImage.Exclamation);
return Task.FromResult(true);
}
if (_callout1TextSymbol == null)
return Task.FromResult(true);
var textGraphic = new CIMTextGraphic
{
Symbol = _callout1TextSymbol.MakeSymbolReference(),
Shape = geometry as MapPoint,
Text = "First Text"
};
var lowTextGraphic = new CIMTextGraphic
{
Symbol = _callout2TextSymbol.MakeSymbolReference(),
Shape = geometry as MapPoint,
Text = "Second Text"
};
return QueuedTask.Run(() =>
{
_selectedGraphicLayer.AddElement(textGraphic);
_selectedGraphicLayer.AddElement(lowTextGraphic);
return true;
});
}
private static Task<CIMTextSymbol> CreateBalloonCalloutAsync()
{
return QueuedTask.Run<CIMTextSymbol>(() =>
{
//create a text symbol
var textSymbol = SymbolFactory.Instance.ConstructTextSymbol(ColorFactory.Instance.WhiteRGB, 11, "Corbel", "Regular");
//A balloon callout
var balloonCallout = new CIMBalloonCallout();
//set the callout's style
balloonCallout.BalloonStyle = BalloonCalloutStyle.RoundedRectangle;
//Create a solid fill polygon symbol for the callout.
var polySymbol = SymbolFactory.Instance.ConstructPolygonSymbol(ColorFactory.Instance.BlackRGB, SimpleFillStyle.Solid);
//Set the callout's background to be the black polygon symbol
balloonCallout.BackgroundSymbol = polySymbol;
//margin inside the callout to place the text
balloonCallout.Margin = new CIMTextMargin
{
Left = 5,
Right = 5,
Bottom = 5,
Top = 5
};
//assign the callout to the text symbol's callout property
textSymbol.Callout = balloonCallout;
return textSymbol;
});
}
}
... View more
10-28-2022
12:18 PM
|
0
|
0
|
907
|
|
POST
|
This code worked for me. To test I have a feature class (County) and a table with related records (CountyTable). After i subscribe to the featureclass's row delete event, the related record is deleted after the feature is deleted. This screen shot is after i deleted the 'Larimer' county: I used the following code to accomplish this. I think the issue is that you have to attach your delete (of the related row) to the 'parent edit operation'. internal class ActivateRelatedDeletes : Button
{
private SubscriptionToken _rowDeletedToken;
private StandaloneTable _countyTable = null;
protected override void OnClick()
{
if (MapView.Active == null)
{
MessageBox.Show("No active map");
return;
}
QueuedTask.Run(() =>
{
_countyTable = MapView.Active.Map.GetStandaloneTablesAsFlattenedList().OfType<StandaloneTable>().Where(fl => fl.Name.Contains("CountyTable")).FirstOrDefault();
if (_countyTable == null)
{
MessageBox.Show("Cannot find County Table");
return;
}
var featureLayer = MapView.Active.Map.GetLayersAsFlattenedList().OfType<FeatureLayer>().Where(fl => fl.Name.Contains("County")).FirstOrDefault();
if (featureLayer == null)
{
MessageBox.Show("No County feature layer found");
return;
}
var addLinkedOperation = new EditOperation
{
Name = "Add linked rows"
};
_rowDeletedToken = RowDeletedEvent.Subscribe(OnRowEvent, featureLayer.GetTable());
});
}
private void OnRowEvent(RowChangedEventArgs delEventArgs)
{
// get the parent Edit operation
var deleteEditOp = delEventArgs.Operation;
// delete all related records using the FIPS relationship
System.Diagnostics.Trace.WriteLine($@"Deleted related: {delEventArgs.Row["NAME"]}");
var atts = new Dictionary<string, object>();
QueryFilter qf = new QueryFilter { WhereClause = $"FIPS = '{delEventArgs.Row["FIPS"]}'" };
using (var tableCursor = _countyTable.Search(qf))
{
while (tableCursor.MoveNext())
{
using (var tableRow = tableCursor.Current)
{
deleteEditOp.Delete(tableRow);
}
}
}
}
}
... View more
10-27-2022
05:31 PM
|
1
|
1
|
2510
|
|
POST
|
What kind of Enterprise GDB are you using and is the table (or feature class) in the content of your map?
... View more
10-25-2022
02:32 PM
|
0
|
1
|
2531
|
|
POST
|
I tried your code snippet with a SQL Server Enterprise GDB and it works as expected. Here are my modifications: protected override void OnClick()
{
if (MapView.Active == null)
{
MessageBox.Show("No active map");
return;
}
QueuedTask.Run(() =>
{
var featureLayer = MapView.Active.Map.GetLayersAsFlattenedList().OfType<FeatureLayer>().FirstOrDefault();
if (featureLayer == null)
{
MessageBox.Show("No Counties feature layer found");
return;
}
Table dnoXrefTable = featureLayer.GetTable();
QueryFilter qf = new QueryFilter { WhereClause = $"STATE_NAME like ('New%')" };
var deleteOperation = new EditOperation
{
Name = "Delete features"
};
using (var rowCursor = dnoXrefTable.Search(qf, false))
{
while (rowCursor.MoveNext())
{
using (var row = rowCursor.Current)
{
deleteOperation.Delete(row);
}
}
}
var delResult = deleteOperation.Execute();
if (delResult != true)
MessageBox.Show($@"Not successful: {deleteOperation.ErrorMessage}");
MessageBox.Show("Edit operation complete");
});
} I am using a copy of the Counties dataset (from the c:\data\admin folder using Community Samples data). I coded my queryfilter to delete all counties where the state name contains 'New...'. Here are my screen shots: 1. Before i click my delete button: 2. the delete function has completed: 3. After the OnClick exits (New York and New Hampshire are gone): If i run the same delete function again i get this message: So you get no message at all?
... View more
10-25-2022
01:03 PM
|
1
|
1
|
2541
|
|
POST
|
Well it was worth a try. I will use an Enterprise table to try this. I didn't see anything wrong with your code.
... View more
10-25-2022
10:51 AM
|
1
|
0
|
2560
|
|
POST
|
Instead of using EditOperation you can also use this: dnoXrefTable.DeleteRows(qf);
... View more
10-25-2022
10:35 AM
|
1
|
1
|
2569
|
|
POST
|
Using the WpfAnimatedGif NuGet I implemented this sample in SplashScreen.xaml of my Pro Configuration: <Window x:Class="ProConfigStartAnimation.UI.SplashScreen"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:local="clr-namespace:ProConfigStartAnimation"
xmlns:gif="http://wpfanimatedgif.codeplex.com"
mc:Ignorable="d"
ResizeMode="NoResize"
Topmost="False"
ShowInTaskbar="False"
WindowStartupLocation="CenterScreen"
WindowStyle="None"
Width="648" Height="328">
<Grid>
<Border BorderBrush="Black" BorderThickness="3" Margin="10">
<StackPanel Orientation="Vertical">
<Image Source="../Images/FolderOpenState32.png" Width="32" Height="32" />
<Image gif:ImageBehavior.AnimatedSource="../Images/earth.gif" Width="192" Height="192" />
<TextBlock FontSize="50"
HorizontalAlignment="Center"
VerticalAlignment="Center">
ProConfigStartAnimation
</TextBlock>
</StackPanel>
</Border>
</Grid>
</Window> I attached my sample project for your reference.
... View more
10-25-2022
06:04 AM
|
0
|
0
|
2231
|
| Title | Kudos | Posted |
|---|---|---|
| 1 | 10-07-2025 07:27 AM | |
| 2 | 3 weeks ago | |
| 1 | 07-30-2025 12:03 PM | |
| 1 | 10-06-2025 01:19 PM | |
| 1 | 10-06-2025 10:37 AM |
| Online Status |
Offline
|
| Date Last Visited |
Sunday
|