|
POST
|
Hi Brad, Here are some snippets that make simple renderers: SimpleRenderers Thanks Uma
... View more
10-24-2018
04:55 PM
|
0
|
0
|
1125
|
|
POST
|
Hi Brad, You could also add a definition to a feature layer using BasicFeatureLayer.SetDefinitionQuery. You can see a sample with this method: QueryBuilderControl Thanks Uma
... View more
10-23-2018
05:19 PM
|
1
|
2
|
1125
|
|
POST
|
Hi You can create your own state to check this - ProGuide: Code Your Own States and Conditions If you subscribe to the MapSelectionChangedEvent, you will be able to see when the Selection changed. You can then check if any of the layers selected were of type PolyLine. //In the module class subscribe to the MapSelection Event.
protected override bool Initialize(){
MapSelectionChangedEvent.Subscribe(OnMapSelectionChanged);
return base.Initialize();
}
//Event handler checks if the layer selected is a PolyLine.
private void OnMapSelectionChanged(MapSelectionChangedEventArgs obj){
foreach (var item in obj.Selection)
{
var featureLayer = item.Key as FeatureLayer;
if (featureLayer.ShapeType == esriGeometryType.esriGeometryPolyline)
MessageBox.Show($"Polyline feature layer {item.Key.Name} selected");
}
} Thanks Uma
... View more
10-23-2018
01:50 PM
|
0
|
0
|
486
|
|
POST
|
Hi Dan, I have informed the development team about this issue you have reported. Thanks for posting the problem you found so we can test this out. Thanks Uma
... View more
10-23-2018
09:02 AM
|
0
|
0
|
975
|
|
POST
|
Here is a code snippet to create a new label class and assign it to a feature layer. Thanks Uma QueuedTask.Run(() => {
var lyr = MapView.Active.Map.GetLayersAsFlattenedList().OfType<FeatureLayer>().First();
//get the layer's defintion
var lyrDefn = lyr.GetDefinition() as CIMFeatureLayer;
//Text symbol to use for labelling
var textSymbol = SymbolFactory.Instance.ConstructTextSymbol();
//Create the new label class and initialize props
var newLabelClass = new CIMLabelClass
{
//Define the label expression engine
ExpressionEngine = LabelExpressionEngine.Arcade,
//Expression to use to label
Expression = "$feature.NAME + $feature.Shape_Area",
Visibility = true,
TextSymbol = textSymbol.MakeSymbolReference(),
Name = "MyNewLabelClass"
};
//Most of the Maplex and standard engine placement properties get set automatically.
//But you have to set the feature type explicitly. Line seems default.
var maplexLabelPlacementProps = new CIMMaplexLabelPlacementProperties
{
FeatureType = LabelFeatureType.Polygon
};
var standardLabelPlacementProps = new CIMStandardLabelPlacementProperties
{
FeatureType = LabelFeatureType.Polygon
};
//Set the placement prop defined to the label class.
newLabelClass.MaplexLabelPlacementProperties = maplexLabelPlacementProps;
newLabelClass.StandardLabelPlacementProperties = standardLabelPlacementProps;
//Get the layer's label classes
var lyrsLabelsClasses = lyrDefn.LabelClasses.ToList();
//Add the new label class to the labels label class
lyrsLabelsClasses.Add(newLabelClass);
lyrDefn.LabelClasses = lyrsLabelsClasses.ToArray(); //Set the labelClasses back
lyr.SetDefinition(lyrDefn); //set the layer's definition;
});
... View more
10-23-2018
08:33 AM
|
0
|
4
|
1794
|
|
POST
|
Hi You can use the MapPropertyChangedEvent. When you change the datum transformation on a map, this event is fired. You can subscribe to this event in your module class. Below is a code snippet that subscribes to the event, and an event handler that is called when it triggers. In the event handler, we check the Map Definition's DatumTransforms or HVDatumTransforms property to get the changed value. Note: Store the current (previous) values for the Datum also in the module class to compare with the changed value you get from the event handler. Thanks Uma protected override bool Initialize(){
MapPropertyChangedEvent.Subscribe(OnMapPropertyChanged);
return base.Initialize();
}
private void OnMapPropertyChanged(MapPropertyChangedEventArgs obj){
if (obj.EventHints.Any())
{
if (MapView.Active.Map is null)
return;
var cimMapDefinition = MapView.Active.Map.GetDefinition();
var datumTransformations = cimMapDefinition.DatumTransforms; // use if map's sr does not have a vertical coordinate system
var hvDatumTransformations = cimMapDefinition.HVDatumTransforms; // use if map's sr has a vertical coordinate system
}
}
... View more
10-22-2018
10:06 AM
|
0
|
0
|
720
|
|
POST
|
Hi, Check out this response: how to retrieve/set metadata on a layer But you should be able to get and set metadata for project items at this time: * Item Metadata * Snippets: Snippets:GetXML Snippets:SetXML Thanks Uma
... View more
10-19-2018
11:22 AM
|
0
|
5
|
2415
|
|
POST
|
Hi Roman The button element cannot have a <content> child element. The schema does not allow this. The <content> tag can be added as a child element of the <insertComponent> element only. The following gives an example of a usage for this from the ADMapping.daml. <insertComponent id="esri_mapping_bookmarks" className="BookmarksEmbeddableControlViewModel">
<content className="BookmarksEmbeddableControlView" relatedCommand="esri_mapping_showBookmarksWindow" autoRunOnly="true"/>
</insertComponent> Thanks Uma
... View more
10-17-2018
01:36 PM
|
2
|
0
|
840
|
|
POST
|
Hi Max On my machine I was able to add the layer file using your sample in 28 seconds. So not sure what is happening. Can you try contacting technical support to see if they can help figure out what is causing this delay on your machine. Thanks Uma
... View more
10-17-2018
11:12 AM
|
0
|
0
|
656
|
|
POST
|
Hi Michael We are looking into implementing a similar method in the Pro API for the 2.4 release. Thanks! Uma
... View more
10-17-2018
08:26 AM
|
2
|
1
|
740
|
|
POST
|
Hi It is a two step process to work with Abbreviation Dictionary. You first have to create the dictionary and add it to the Map definition and then apply the dictionary to a specific layer. This method below creates a dictionary and adds it to the Active map's definition: public void LoadDictionary()
{
//Get the map's defintion
var mapDefn = MapView.Active.Map.GetDefinition();
//Get the Map's Maplex labelling engine properties
var mapDefnPlacementProps = mapDefn.GeneralPlacementProperties as CIMMaplexGeneralPlacementProperties;
//Define the abbreaviations we need in an array
List<CIMMaplexDictionaryEntry> abbreviationDictionary = new List<CIMMaplexDictionaryEntry>
{
new CIMMaplexDictionaryEntry {
Abbreviation = "Hts",
Text = "Heights",
MaplexAbbreviationType = MaplexAbbreviationType.Ending
},
new CIMMaplexDictionaryEntry
{
Abbreviation = "Ct",
Text = "Text",
MaplexAbbreviationType = MaplexAbbreviationType.Ending
}
//etc
};
//The Maplex Dictionary - can hold multiple Abbreviation collections
var maplexDictionary = new List<CIMMaplexDictionary>
{
new CIMMaplexDictionary {
Name = "NameEndingsAbbreviations",
MaplexDictionary = abbreviationDictionary.ToArray()
}
};
//Set the Maplex Label Engine Dictionary property to the Maplex Dictionary collection created above.
mapDefnPlacementProps.Dictionaries = maplexDictionary.ToArray();
//Set the Map defintion
MapView.Active.Map.SetDefinition(mapDefn);
} Second step, apply a specific abbreviation dictionary in the Map Definition to the layer: var featureLayer = MapView.Active.Map.GetLayersAsFlattenedList().OfType<FeatureLayer>().First();
QueuedTask.Run( () => {
//Creates Abbreviation dictionary and adds to Map Defintion
LoadDictionary();
//Get the layer's definition
var lyrDefn = featureLayer.GetDefinition() as CIMFeatureLayer;
//Get the label classes - we need the first one
var listLabelClasses = lyrDefn.LabelClasses.ToList();
var theLabelClass = listLabelClasses.FirstOrDefault();
//Modify label Placement props to use abbreviation dictionary
CIMGeneralPlacementProperties labelEngine = MapView.Active.Map.GetDefinition().GeneralPlacementProperties;
theLabelClass.MaplexLabelPlacementProperties.DictionaryName = "NameEndingsAbbreviations";
theLabelClass.MaplexLabelPlacementProperties.CanAbbreviateLabel = true;
theLabelClass.MaplexLabelPlacementProperties.CanStackLabel = false;
//Set the labelClasses back
lyrDefn.LabelClasses = listLabelClasses.ToArray();
//set the layer's definition
featureLayer.SetDefinition(lyrDefn);
}); Thanks Uma
... View more
10-17-2018
05:34 AM
|
3
|
1
|
1335
|
|
POST
|
Hi Laimonas, Here is a section in our wiki that discusses how to get the list of ArcGIS Pro licenses checked out : Check-in and Check-out licences This section also has a code snippet showing you how you can implement this in an add-in. Is this the information you are looking for? Thanks Uma
... View more
10-16-2018
10:11 AM
|
0
|
0
|
477
|
|
POST
|
Hi Brian I ran your code to find a field in a layer that has a Join. It worked fine for me. I was able to find a field in the base layer and in the "joined" layer's fields. Not sure why this is crashing for you. Is there anything unique about your dataset? I used a file gdb on my local machine. Thanks Uma
... View more
10-16-2018
08:51 AM
|
0
|
4
|
2550
|
|
POST
|
Hi Max Here is a snippet on the SDK Wiki page that can help creating a point symbol with a specific border color/thickness. Currently there is no overload for the ConstructPointSymbol method that can do this. Point Symbol with custom fill and outline Thanks Uma
... View more
10-15-2018
12:58 PM
|
3
|
0
|
1665
|
|
POST
|
Hi Karsten, You could create a public static property in the module class and set that to the check box's IsChecked property. class ProCheckbox : ArcGIS.Desktop.Framework.Contracts.CheckBox
{
public ProCheckbox()
{
IsChecked = true;
}
protected override void OnClick()
{
// TODO - add specific customization here as necessary
//Module1.CheckBoxIsChecked is a public static property in the module class file.
Module1.CheckBoxIsChecked = IsChecked.HasValue ? IsChecked.Value : false;
MessageBox.Show($"Checked: {Module1.CheckBoxIsChecked}");
}
}
... View more
10-09-2018
09:49 AM
|
1
|
1
|
1403
|
| Title | Kudos | Posted |
|---|---|---|
| 1 | 09-18-2025 03:09 PM | |
| 1 | 11-04-2025 08:25 AM | |
| 1 | 09-23-2025 09:31 AM | |
| 1 | 11-20-2024 10:50 AM | |
| 1 | 04-28-2025 03:06 PM |
| Online Status |
Offline
|
| Date Last Visited |
2 weeks ago
|