POST
|
As far as I know you can't update this from the UI. These are the only options I know of: https://pro.arcgis.com/en/pro-app/help/mapping/navigation/configure-pop-ups.htm However, for Pro UI questions you should post your question here to make sure: https://community.esri.com/t5/arcgis-pro-questions/bd-p/arcgis-pro-questions
... View more
12-03-2020
08:45 AM
|
0
|
0
|
268
|
POST
|
You can create a class library with your common code, in this case mainly this interface: public interface IFromConfiguration
{
string UserName { get; set; }
} Include a reference to this library in both the configuration and the add-in. In the configuration you need to implement the interface in your Module class (which in my case is called ConfigurationModule): internal class ConfigurationModule : Module, IFromConfiguration
{
/// ... existing Module code ....
internal string UserName { get; set; }
string IFromConfiguration.UserName { get => UserName; set { UserName = value; } }
/// ... existing Module code ....
} In your add-in you can now access the configuration as follows - this is from a button OnClick method: try
{
// get the configuration module:
var configModule = FrameworkApplication.FindModule("ProConfigurationTest_Module");
if (configModule is ProConfigurationTest.IFromConfiguration configInterface)
{
MessageBox.Show($@"Username from configuration: {configInterface.UserName}");
}
}
catch (Exception ex)
{
MessageBox.Show($@"Error: {ex}");
}
... View more
12-03-2020
08:44 AM
|
0
|
0
|
266
|
POST
|
If this is what you want to implement: You can model your add-in's config.daml after this: <modules>
<insertModule id="GroupInsertTest_Module" className="Module1" autoLoad="false" caption="Module1">
<groups>
<group id="GroupInsertTest_Group1" caption="Group 1" appearsOnAddInTab="true">
<button refID="GroupInsertTest_Button1" size="large" />
<button refID="GroupInsertTest_Button2" size="large" />
</group>
</groups>
<controls>
<!-- add your controls here -->
<button id="GroupInsertTest_Button1" caption="Button 1" className="Button1" 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>
<button id="GroupInsertTest_Button2" caption="Button 2" className="Button2" 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>
<!--Modifying Core Map Tab-->
<updateModule refID="esri_mapping">
<tabs>
<updateTab refID="esri_mapping_homeTab" >
<insertGroup refID="GroupInsertTest_Group1" placeWith="esri_mapping_offlineGroup" insert="after" />
</updateTab>
</tabs>
</updateModule>
</modules> There's also a sample that adds a button to the "esri mapping homeTab" arcgis-pro-sdk-community-samples/Framework/WorkingWithDAML at master · Esri/arcgis-pro-sdk-community-samples · GitHub
... View more
11-09-2020
11:27 AM
|
1
|
3
|
687
|
POST
|
Looking at your code snippet above I could only deduct that you tried to display a map on your dockpane. A Frame in WPF can be used to host WPF or HTML content. Using the WPF content option for the Frame you can use a MapControl which would allow you to display a map created by MapFactory in your dockpane. To implement this you can use my sample link above. In your code snippet in your original question you try to display HTML content, but you pass in a unique identifier which happens to be in URI format (https://pro.arcgis.com/en/pro-app/sdk/api-reference/#topic11907.html). ArcGIS Pro doesn't serve up web maps that can be displayed as HTML content.
... View more
11-06-2020
06:33 AM
|
2
|
2
|
1166
|
POST
|
I am not sure if you need a map control on your dockpane, if so then there is a sample that shows a map control in a dockpane: OverviewMapControl
... View more
11-05-2020
05:04 PM
|
0
|
4
|
1166
|
POST
|
As a last resort you can look at the mapping extension's daml definitions here (assuming you did a default install): C:\Program Files\ArcGIS\Pro\bin\Extensions\Mapping\ADMapping.daml But before that you can try to use this option in ArcGIS Pro: under ‘Customize the Ribbon’ check the "Show command IDs" option. Now when you hover with your mouse over a button you should see the ID displayed:
... View more
10-23-2020
01:30 PM
|
0
|
0
|
893
|
POST
|
I attached the sample code to create a Unique Value Renderer. I also attached a sample Pro project that works in conjunction with the sample code. The key code snippet is the creation of the unique value renderer: /// <summary>
/// You must call this method on the MCT!
/// </summary>
/// <returns></returns>
private CIMRenderer CreateUniqueValueRendererUsingColorTable(FeatureLayer lyrToColor,
StandaloneTable colorTable)
{
//All of these methods have to be called on the MCT
if (OnUIThread)
throw new ArcGIS.Core.CalledOnWrongThreadException();
//make a dictionary with MapUnit and Color
var dicMapUnitColor = new Dictionary<int, string>();
using (var rowCursor = colorTable.Search())
{
while (rowCursor.MoveNext())
{
using (var anyRow = rowCursor.Current)
{
dicMapUnitColor.Add((int)anyRow["MapUnit"], anyRow["Color"].ToString());
}
}
}
//Create the Unique Value Renderer
CIMUniqueValueRenderer uniqueValueRenderer = new CIMUniqueValueRenderer()
{
// set the value field
Fields = new string[] { "MapUnit" }
};
//Construct the list of UniqueValueClasses
List<CIMUniqueValueClass> classes = new List<CIMUniqueValueClass>();
//define the unique values for each dicMapUnitColor entry
foreach (var key in dicMapUnitColor.Keys)
{
var lstValue = new List<CIMUniqueValue>()
{
new CIMUniqueValue()
{
FieldValues = new string[] { key.ToString() }
}
};
var namedColor = System.Drawing.Color.FromName(dicMapUnitColor[key]);
var theColor = CIMColor.CreateRGBColor(namedColor.R, namedColor.G, namedColor.B);
classes.Add(
new CIMUniqueValueClass()
{
Values = lstValue.ToArray(),
Label = $@"Color: {dicMapUnitColor[key]}",
Visible = true,
Editable = true,
Symbol = new CIMSymbolReference() {
Symbol = SymbolFactory.Instance.ConstructPointSymbol(
SymbolFactory.Instance.ConstructMarker(theColor, 20, SimpleMarkerStyle.Pushpin)) }
}
);
}
//Add the classes to a group (by default there is only one group or "symbol level")
// Unique value groups
CIMUniqueValueGroup groupOne = new CIMUniqueValueGroup()
{
Heading = "By Color",
Classes = classes.ToArray()
};
uniqueValueRenderer.Groups = new CIMUniqueValueGroup[] { groupOne };
//Draw the rest with the default symbol
uniqueValueRenderer.UseDefaultSymbol = true;
uniqueValueRenderer.DefaultLabel = "All other values";
var defaultColor = CIMColor.CreateRGBColor(215, 215, 215);
uniqueValueRenderer.DefaultSymbol = new CIMSymbolReference()
{
Symbol = SymbolFactory.Instance.ConstructPointSymbol(
SymbolFactory.Instance.ConstructMarker(defaultColor, 15, SimpleMarkerStyle.Diamond))
};
return uniqueValueRenderer as CIMRenderer;
} Running the add-in using this input: and then changes the colors using the lookup:
... View more
10-21-2020
04:25 PM
|
1
|
1
|
1031
|
POST
|
The link you are referring to covers the 'Runtime SDK' not the 'Pro SDK'. I will try to publish a small sample later today.
... View more
10-20-2020
12:52 PM
|
0
|
0
|
1031
|
POST
|
You can use either the hostname, name, or the IsPortal flag (true if not AGOL) from PortalInfo: using this snippet: protected override async void OnClick()
{
try
{
var portal = ArcGISPortalManager.Current.GetActivePortal();
//Force login
if (!portal.IsSignedOn())
{
portal.SignIn();
}
//If the sign in failed, this will be the default view of the portal
var portalInfo = await portal.GetPortalInfoAsync();
MessageBox.Show($@"hostname: {portalInfo.PortalHostName} name: {portalInfo.PortalName} isportal: {portalInfo.IsPortal}");
}
catch (Exception ex)
{
MessageBox.Show($@"Error: {ex}");
}
}
... View more
10-15-2020
08:14 AM
|
0
|
1
|
663
|
POST
|
I am not sure if attributes in related tables are supported, however, you can try set this up through the Pro UI and then check the CIM, if it is supported. You can also use a Unique Value Renderer which you can build from your color lookup table. With a UniqueValue Renderer you also get a proper legend in the table of content. Unique Value Renderer sample
... View more
10-09-2020
02:31 PM
|
0
|
1
|
1120
|
POST
|
Hi Douglas, Actually there is a sample for attribute driven symbology here: Renderer - AttributeDrivenSymbology.cs even so this sample shows rotation, however, if you don't have a sample for your rendering needs, you can follow the approach outlined here: I use the CIMViewer to take a look at a symbol that is using attribute values for its color. The CIMViewer add-in allows you to look at the cartographic information model for each CIMFeatureLayer, which in turn contains the CIMRenderer definition. I changed my layer's symbology through the Pro UI to use an attribute driven color and looking at the CIMViewer's XML output, I found that my CIMSimpleRenderer had been modified as shown below in order to support the coloring by attribute value (you can see the XML of the CIM Renderer). Also a matching 'PrimitiveName' reference was added to the symbol layer that needed the color replaced (not shown here): <Renderer xsi:type="typens:CIMSimpleRenderer">
<Patch>Default</Patch>
<Symbol xsi:type="typens:CIMSymbolReference">
<PrimitiveOverrides xsi:type="typens:ArrayOfCIMPrimitiveOverride">
<CIMPrimitiveOverride xsi:type="typens:CIMPrimitiveOverride">
<PrimitiveName>d704d106-8f6f-4ef4-8ee9-3e8c4c7a2c8c</PrimitiveName>
<PropertyName>FillColor</PropertyName>
<Expression />
<ValueExpressionInfo xsi:type="typens:CIMExpressionInfo">
<Expression>$feature.Color</Expression>
<ReturnType>Default</ReturnType>
</ValueExpressionInfo>
</CIMPrimitiveOverride>
</PrimitiveOverrides>
<Symbol xsi:type="typens:CIMPointSymbol">
.......
<SymbolLayers xsi:type="typens:ArrayOfCIMSymbolLayer">
<CIMSymbolLayer xsi:type="typens:CIMVectorMarker">
...
<MarkerGraphics xsi:type="typens:ArrayOfCIMMarkerGraphic">
<CIMMarkerGraphic xsi:type="typens:CIMMarkerGraphic">
<PrimitiveName>d704d106-8f6f-4ef4-8ee9-3e8c4c7a2c8c</PrimitiveName>
</CIMMarkerGraphic>
</MarkerGraphics>
...
</CIMSymbolLayer> If you look at the sample referenced above using the CIMView's XML output, you can come up with a snippet like the one below that changes the color using the text field "TestPoints.Color", which contains values like 'Red', 'Green', 'Blue'. Note that the 'PrimitiveName' in the primitive override has to match the one in the CIMMarkerGraphics. protected override void OnClick()
{
var lyr = MapView.Active.Map.GetLayersAsFlattenedList().OfType<FeatureLayer>().Where(f => f.Name == "TestPoints").FirstOrDefault();
if (lyr == null) return;
QueuedTask.Run(() => {
//Get the layer's renderer
var renderer = lyr.GetRenderer() as CIMSimpleRenderer;
var primitiveName = Guid.NewGuid().ToString();
var cimPO = new CIMPrimitiveOverride()
{
PrimitiveName = primitiveName,
PropertyName = @"FillColor",
Expression = null,
ValueExpressionInfo = new CIMExpressionInfo()
{
Expression = @"$feature.Color",
ReturnType = ExpressionReturnType.Default
}
};
(renderer.Symbol.Symbol as CIMPointSymbol).SymbolLayers[0].PrimitiveName = primitiveName;
var overrideList = new CIMPrimitiveOverride[1];
overrideList[0] = cimPO;
//Apply symbol overrides
renderer.Symbol.PrimitiveOverrides = overrideList;
//Apply the renderer to the feature layer
lyr.SetRenderer(renderer);
});
}
... View more
10-07-2020
05:35 PM
|
2
|
3
|
1120
|
POST
|
You can use the registry path HKEY_LOCAL_MACHINE\SOFTWARE\ESRI\ArcGISPro\PythonCondaRoot to retrieve the python root folder used by Pro.
... View more
10-07-2020
02:08 PM
|
2
|
1
|
1273
|
POST
|
Formatted text in the Description attribute is not supported. I would suggest to use an 'about style' ProWindows popup for formatted output instead.
... View more
10-06-2020
02:57 PM
|
0
|
0
|
263
|
POST
|
Hi Denny Peltz, As you can see from my reply I didn't even check if a range is allowed 😞 Thanks for pointing this out, one should never underestimate the capabilities of Pro 🙂
... View more
10-02-2020
11:06 AM
|
1
|
0
|
684
|
POST
|
Hi Muhammet İkbal Yaşar, Can you provide more detail on which SDK functionality you are having a problem with? Is it an API function or a GP tool?
... View more
10-02-2020
09:37 AM
|
0
|
3
|
1448
|
Title | Kudos | Posted |
---|---|---|
1 | a month ago | |
1 | 02-21-2024 10:14 AM | |
1 | 01-05-2024 05:27 AM | |
1 | 01-02-2024 12:02 PM | |
1 | 07-30-2021 12:30 PM |
Online Status |
Offline
|
Date Last Visited |
2 weeks ago
|