|
POST
|
I haven't tried this yet, but any DAML 'dependencies' needed to be specified in earlier versions of Pro. I think if you specify the 'dependencies' tag in the 2.5 DAML this should work in 2.5 as well. You have to add the 'module's DAML filename' that you are 'depending' on like it is shown in the snippet below. You can find the module's name in the DAML reference documentation . The dependencies tag is inserted before the modules tag: <ArcGIS defaultAssembly="CustomCatalogContext.dll" ...>
<AddInInfo id="...
</AddInInfo>
<dependencies>
<dependency name="ADCore.daml" />
<dependency name="ADMapping.daml" />
</dependencies>
<modules>
... View more
03-17-2021
09:30 AM
|
0
|
1
|
6583
|
|
POST
|
Kirk's assessment is correct, OnUpdateDatabase presents the last opportunity to make changes to the DAML model. I tried different workarounds, but the only workaround I found was to replace the splash screen with a popup window that prompts the user for input. Needless to say this means that your code-behind on the splash screen cannot use any Pro API functionality. I attached my sample app in case it can be of use.
... View more
03-15-2021
05:02 PM
|
0
|
0
|
1845
|
|
POST
|
Pro Addins cannot be automatically downloaded from a Github repo release. You can however use the GitHub Rest API to write your own extension to your add-in to perform this task. Using the GitHub Rest API (i.e. https://github.com/octokit/octokit.net ) your add-in can check and download the latest release and update itself in any local well-known folder.
... View more
03-12-2021
10:22 AM
|
1
|
0
|
1513
|
|
POST
|
Thanks Kirk for pointing this out. This appears to be a problem in 2.7.x. We retested this issue in the upcoming 2.8 release and it has been fixed in 2.8.
... View more
03-12-2021
10:04 AM
|
0
|
0
|
1988
|
|
POST
|
You can lookup the existing DAML ids in this reference: ArcGIS Pro DAML ID Reference You can also look at the Pro DAML directly by using the ".daml file" links in this reference. The following document has more information on DAML: Introduction to DAML (Desktop Application Markup Language) in addition to the help already mentioned above. And here is an example that inserts a group with your new button in the 'Insert' tab on the ribbon: <ArcGIS defaultAssembly="UpdateInsertTab.dll" defaultNamespace="UpdateInsertTab" xmlns="http://schemas.esri.com/DADF/Registry" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://schemas.esri.com/DADF/Registry file:///C:/Program%20Files/ArcGIS/Pro/bin/ArcGIS.Desktop.Framework.xsd">
<AddInInfo id="{4fd9b454-7bce-426f-8bfe-9833c882f99d}" version="1.0" desktopVersion="2.7.26828">
<Name>UpdateInsertTab</Name>
<Description>UpdateInsertTab description</Description>
<Image>Images\AddinDesktop32.png</Image>
<Author>wlfka</Author>
<Company>Acme</Company>
<Date>3/12/2021 7:42:07 AM</Date>
<Subject>Framework</Subject>
</AddInInfo>
<modules>
<insertModule id="UpdateInsertTab_Module" className="Module1" autoLoad="false" caption="Module1">
<groups>
<group id="UpdateInsertTab_Group1" caption="Group 1" appearsOnAddInTab="false">
<button refID="UpdateInsertTab_InsertTabButton" size="large" />
</group>
</groups>
<controls>
<!-- add your controls here -->
<button id="UpdateInsertTab_InsertTabButton" caption="InsertTabButton"
className="InsertTabButton" loadOnClick="true"
smallImage="pack://application:,,,/ArcGIS.Desktop.Resources;component/Images/GenericButtonBlue16.png"
largeImage="pack://application:,,,/ArcGIS.Desktop.Resources;component/Images/GenericButtonBlue32.png">
<tooltip heading="Tooltip Heading">Tooltip text<disabledText /></tooltip>
</button>
</controls>
</insertModule>
<updateModule refID="esri_core_module">
<tabs>
<updateTab refID="esri_core_insertTab" >
<insertGroup refID="UpdateInsertTab_Group1" placeWith="esri_project_styles" insert="before"/>
</updateTab>
</tabs>
</updateModule>
</modules>
</ArcGIS> this looks like this:
... View more
03-12-2021
09:59 AM
|
1
|
1
|
6629
|
|
POST
|
It turns out that the ItemID is stored in the layer's underlying Cartographic Information Model (CIM). More specifically the ItemID value is stored in the SourceURI property of the CIMFeatureLayer class. The SourceURI property is only populated when the layer is first added to a map, but the property is not updated when the data connection is changed. To update the SourceURI you can use the following pattern (from within QueuedTask.Run): var dcLyr = MapView.Active.Map.GetLayersAsFlattenedList().OfType<FeatureLayer>().FirstOrDefault();
QueuedTask.Run(() =>
{
if (!(dcLyr.GetDataConnection() is CIMStandardDataConnection dc))
{
MessageBox.Show("Layer doesn't have CIMStandardDataConnection");
return;
}
// make changes to the data connection
dcLyr.SetDataConnection(dc);
// update SourceURI
var lyrDef = dcLyr.GetDefinition();
lyrDef.SourceURI = string.Empty;
dcLyr.SetDefinition(lyrDef);
}); In the snippet above the SourceURI is cleared, but it can also be replaced with the ItemID matching the new data connection.
... View more
03-11-2021
10:52 AM
|
0
|
0
|
6397
|
|
POST
|
My bad, I guess I overlooked the 'ArcGIS Online' part. The actual 'Feature Service' is hosted on ArcGIS Server referenced the the "url" attribute of the "operationallayer" json from your previous reply. I only looked at the ArcGIS Server datassource, not a Portal (ArcGIS Online) connection. I will try a Portal datasource now and let you know what i find.
... View more
03-10-2021
11:56 AM
|
0
|
0
|
6432
|
|
POST
|
To change the URL to the hosted feature service you have to change the Url, to change the ID you have to change the Dataset property as shown in the sample below. When you say you have to change the 'ItemID' to the hosted feature service do you mean the ID? As shown here: If so then, my sample applies to your question. in the sample I change this (note that the ID is shown under the Name line item): To this: In this sample snippet the datasource for the layer is changed from FeatureSerive to MapService and vice versa, and in addition the ID is also changed from '0' to '2' and vice versa. protected override void OnClick()
{
try
{
var dcLyr = MapView.Active.Map.GetLayersAsFlattenedList().OfType<FeatureLayer>().FirstOrDefault();
if (dcLyr == null)
{
MessageBox.Show("No Layer found");
return;
}
QueuedTask.Run(() =>
{
if (!(dcLyr.GetDataConnection() is CIMStandardDataConnection dc))
{
MessageBox.Show("Layer doesn't have CIMStandardDataConnection");
return;
}
if (dc.WorkspaceConnectionString.Contains(@"/FeatureServer"))
dc.WorkspaceConnectionString = dc.WorkspaceConnectionString.Replace(@"/FeatureServer", @"/MapServer");
else
dc.WorkspaceConnectionString = dc.WorkspaceConnectionString.Replace(@"/MapServer", @"/FeatureServer");
if (dc.Dataset == "0")
dc.Dataset = "2";
else
dc.Dataset = "0";
dcLyr.SetDataConnection(dc);
});
}
catch (Exception ex)
{
MessageBox.Show(ex.Message);
}
}
... View more
03-10-2021
11:15 AM
|
0
|
1
|
6437
|
|
POST
|
I have a web map with two feature layers. The first layer in my Map references the first feature layer of my web map. Below is the code for a button's 'OnClick' method, that changes the data connection for this first layer from a feature service ID of '0' to '1' and vice versa. Not sure if this is what you need: protected override void OnClick()
{
try
{
var dcLyr = MapView.Active.Map.GetLayersAsFlattenedList().OfType<FeatureLayer>().FirstOrDefault();
if (dcLyr == null)
{
MessageBox.Show("No Layer found");
return;
}
QueuedTask.Run(() =>
{
CIMStandardDataConnection dc = dcLyr.GetDataConnection() as CIMStandardDataConnection;
if (dc == null)
{
MessageBox.Show("Layer doesn't have CIMStandardDataConnection");
return;
}
if (dc.Dataset == "0")
dc.Dataset = "1";
else
dc.Dataset = "0";
dcLyr.SetDataConnection(dc);
});
}
catch (Exception ex)
{
MessageBox.Show(ex.Message);
}
}
... View more
03-09-2021
03:59 PM
|
0
|
3
|
6443
|
|
POST
|
Hi Michael, I am working on a ParcelFabric API sample for the Dev Summit. The sample will be published with the 2.8 Community samples. The sample handles attribution of parcel features which is what you were asking about. I found that I had to process one parcel at a time in order to perform parcel specific attribution. In my case I wanted to simply add a parcel identification number to each feature (line, polygon) that is part of a parcel. I used the CopyParcelLinesToParcelType API method to 'copy' a parcel to a different parcel type (lot to tax parcel in my case). CopyParcelLinesToParcelType will actually copy existing attribution (as an option), but in case you need to change attribution for the newly created features you can use the following snippet: var editOper = new EditOperation()
{
Name = "Copy Parcels to Tax Type",
ProgressMessage = "Copy To Tax Parcel Type ...",
ShowModalMessageAfterFailure = false,
SelectNewFeatures = false,
SelectModifiedFeatures = false
};
//add the source parcel source, and feature ids to a new KeyValuePair
var polyIds = // List of Object Ids that are part of one lot parcel's polygon feature
var kvp = new KeyValuePair<MapMember, List<long>>(lotLayer, polyIds);
var sourceParcelFeatures = new List<KeyValuePair<MapMember, List<long>>> { kvp };
// This is performed for each parcel
var parcelCopyToken = editOper.CopyParcelLinesToParcelType(_parcelFabricLayer, sourceParcelFeatures, _taxLayerLines, _taxLayerPolys, false, true, true);
if (!editOper.Execute()) return editOper.ErrorMessage;
var createdParcelFeatures = parcelCopyToken.CreatedFeatures;
var modifiedParcelFeatures = parcelCopyToken.ModifiedFeatures;
System.Diagnostics.Debug.WriteLine($@"CopyParcelLinesToParcelType:");
if (parcelCopyToken.CreatedFeatures != null)
{
foreach (var created in parcelCopyToken.CreatedFeatures)
System.Diagnostics.Debug.WriteLine($@"Mapmember: {created.Key} created: {created.Value.Count()}");
}
if (parcelCopyToken.ModifiedFeatures != null)
{
foreach (var modified in parcelCopyToken.ModifiedFeatures)
System.Diagnostics.Debug.WriteLine($@"Mapmember: {modified.Key} modified: {modified.Value.Count()}");
} If I use the snippet above and select a single 'lot' parcel as shown here: I get the following diagnostic output after the selected Lot parcel was copied into my Tax parcels: CopyParcelLinesToParcelType: Mapmember: Tax_Lines created: 7 Mapmember: Tax created: 1 To update attributes of the new Tax_Lines & Tax features I use the Inspector to perform the attribution for each feature: var editOperUpdate = editOper.CreateChainedOperation();
Dictionary<string, object> ParcelAttributes = new Dictionary<string, object>();
foreach (KeyValuePair<MapMember, List<long>> kvp in parcelCopyToken.CreatedFeatures)
{
var mapMember = kvp.Key;
var oids = kvp.Value;
foreach (long oid in oids)
{
var insp = new Inspector();
insp.Load(mapMember, oid);
ParcelAttributes.Clear();
ParcelAttributes.Add(FieldNameTmk, tmk); // column name & new data
ParcelAttributes.Add(..., ...);
editOperUpdate.Modify(mapMember, oid, ParcelAttributes);
}
}
if (!editOperUpdate.Execute())
return editOperUpdate.ErrorMessage;
... View more
03-05-2021
05:53 PM
|
1
|
0
|
1731
|
|
POST
|
ArcGIS Pro is using 'just in time loading' of add-ins. So when Pro starts and displays your button's icon on the tool bar, it is only the icon that is displayed, your add-in code is not running yet. Note that this behavior can be changed in the config.daml under the module tag, but by default 'just in time loading' is enabled. Once you click on the button though (or your dockpane is shown), your code is loaded and executed. So if you click a button and it turns unexpectedly gray one reason can be (as already mentioned by Uma) that your code-behind cannot find the code-behind class name as referenced by name in the className attribute like in this example: <button id="..." caption="..."
className="Dockpane1_ShowButton"
loadOnClick="true" smallImage="....png" largeImage="....png">
</button So if you change the class name in the code-behind and not in the config.daml you get the 'gray' button effect. You can also get a 'gray' button if you code-behind is throwing an exception on startup. As mentioned by Kirk, I would recommend to use source control in which case you can locate your 'suspect' code changes easily be comparing you latest non-functional code with the last working version.
... View more
03-05-2021
12:26 PM
|
0
|
0
|
3867
|
|
POST
|
I tried this as well and found that this works for me as it did for Narelle. I used this as the xaml definition in an attempt to duplicate your issue: <UserControl x:Class="TableControlSize.TestView"
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:ui="clr-namespace:TableControlSize"
xmlns:extensions="clr-namespace:ArcGIS.Desktop.Extensions;assembly=ArcGIS.Desktop.Extensions"
xmlns:editControls="clr-namespace:ArcGIS.Desktop.Editing;assembly=ArcGIS.Desktop.Editing"
mc:Ignorable="d"
d:DesignHeight="300" d:DesignWidth="300"
d:DataContext="{Binding Path=ui.TestViewModel}">
<UserControl.Resources>
<ResourceDictionary>
<ResourceDictionary.MergedDictionaries>
<extensions:DesignOnlyResourceDictionary Source="pack://application:,,,/ArcGIS.Desktop.Framework;component\Themes\Default.xaml"/>
</ResourceDictionary.MergedDictionaries>
</ResourceDictionary>
</UserControl.Resources>
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="Auto"/>
<RowDefinition Height="*"/>
</Grid.RowDefinitions>
<DockPanel Grid.Row="0" LastChildFill="true" KeyboardNavigation.TabNavigation="Local" Height="30">
<TextBlock Grid.Column="1" Text="{Binding Heading}" Style="{DynamicResource Esri_TextBlockDockPaneHeader}">
<TextBlock.ToolTip>
<WrapPanel Orientation="Vertical" MaxWidth="300">
<TextBlock Text="{Binding Heading}" TextWrapping="Wrap"/>
</WrapPanel>
</TextBlock.ToolTip>
</TextBlock>
</DockPanel>
<GroupBox Header="Kontrol" Grid.Row="1">
<Grid x:Name="ControlGrid" ShowGridLines="True">
<Grid.RowDefinitions>
<RowDefinition Height="Auto"/>
<RowDefinition Height="Auto"/>
<RowDefinition Height="*"/>
<RowDefinition Height="Auto"/>
</Grid.RowDefinitions>
<Button Grid.Row="0" Style="{DynamicResource Esri_SimpleButton}"
Content="Header" />
<Button Grid.Row="1" Style="{DynamicResource Esri_SimpleButton}"
Content="1" />
<Border Grid.Row="2">
<editControls:TableControl Name="customTableView"
TableContent="{Binding Path=TableContent}"
ViewMode="eAllRecords">
</editControls:TableControl>
</Border>
<Button Grid.Row="3" Style="{DynamicResource Esri_SimpleButton}"
Content="3" />
</Grid>
</GroupBox>
</Grid>
</UserControl> When I run the add-in i get this output, which is resizable with no problems: As you can see the scroll bars were automatically added to the table control. There was no need to specify Max Width/Height. Hopefully this is working for you now as well.
... View more
03-05-2021
10:59 AM
|
0
|
0
|
2765
|
|
POST
|
I am not aware of any methods to re-enable the progress dialog during debugging. This feature has been disabled by design for reasons unknown to me. I only write my add-ins in managed code and in order to debug a complex issue where I need to see that last state I usually use System.Diagnostics.Debug.WriteLine() to output the state of my code. The output is then displayed in my Visual Studio output window. I am not sure if there's an equivalent C++ method. In some cases when needed to sift through a lot of data I used a log file.
... View more
02-18-2021
01:53 PM
|
0
|
2
|
3103
|
|
POST
|
MapProjectItems contains maps which you can access through the GetMap() method. Each map can be displayed by multiple MapViews. To match MapProjectItems with MapViews that use the same map you would have to iterate through the collections and match the maps using the equals operator. Below is the button code-behind to find the MapProjectItem for the active MapView: protected override async void OnClick()
{
if (MapView.Active?.Map == null) return;
var findThisMap = MapView.Active?.Map;
var result = await QueuedTask.Run<string>(() =>
{
var mpis = Project.Current.GetItems<MapProjectItem>();
foreach (var mpi in mpis)
{
if (findThisMap == mpi.GetMap())
{
return $@"Found map in this project: {mpi.Path}";
}
}
return "not found";
});
MessageBox.Show(result);
}
... View more
02-17-2021
08:25 AM
|
0
|
2
|
3838
|
|
POST
|
I think this sums it up. And yes regarding your last bullet: var mapPanes = ProApp.Panes.OfType<IMapPane>(); mapPanes only contains 'panes' that are actually open. Whereas var mapProjItems = Project.Current.GetItems<MapProjectItem>(); mapProjItems contains all map project items regardless of whether the mapview is open or not.
... View more
02-16-2021
11:47 AM
|
0
|
1
|
3868
|
| Title | Kudos | Posted |
|---|---|---|
| 1 | 10-29-2025 10:48 AM | |
| 1 | 05-24-2021 09:04 AM | |
| 1 | 12-03-2020 08:44 AM | |
| 1 | 10-07-2025 07:27 AM | |
| 2 | 12-29-2025 10:03 AM |
| Online Status |
Offline
|
| Date Last Visited |
05-21-2026
01:59 PM
|