|
POST
|
Hi Luke, yes, metadata is still planned for 1.4 however it will be off the layer and not the feature class.
... View more
07-06-2016
11:00 AM
|
0
|
9
|
2725
|
|
POST
|
I think you are missing the "SetDefinition" call on the layerdef. There is a snippet that shows what you want to do here: Change the layer selection color EDIT: sorry - looks like that snippet hasn't posted yet. This is it: var featureLayer = MapView.Active.Map.GetLayersAsFlattenedList().OfType<FeatureLayer>().FirstOrDefault(); ArcGIS.Desktop.Framework.Threading.Tasks.QueuedTask.Run(() => { // get the CIM definition of the layer var layerDef = featureLayer.GetDefinition() as ArcGIS.Core.CIM.CIMBasicFeatureLayer; // disable the default symbol layerDef.UseSelectionSymbol = false; // assign a new color layerDef.SelectionColor = ColorFactory.RedRGB; // apply the definition to the layer featureLayer.SetDefinition(layerDef); if (!featureLayer.IsVisible) featureLayer.SetVisibility(true); //Do a selection MapView.Active.SelectFeatures(MapView.Active.Extent); });
... View more
06-08-2016
04:09 PM
|
0
|
0
|
2274
|
|
POST
|
Oh, you need this guy too in your Module: /// <summary>Create a linesymbol with circle markers on the ends</summary> internal static Task<CIMLineSymbol> CreateLineSymbolAsync() { return QueuedTask.Run(() => { var lineStroke = SymbolFactory.ConstructStroke(ColorFactory.RedRGB, 4.0); var marker = SymbolFactory.ConstructMarker(ColorFactory.RedRGB, 12, SimpleMarkerStyle.Circle); marker.MarkerPlacement = new CIMMarkerPlacementOnVertices() { AngleToLine = true, PlaceOnEndPoints = true, Offset = 0 }; return new CIMLineSymbol() { SymbolLayers = new CIMSymbolLayer[2] { marker, lineStroke } }; }); }
... View more
04-29-2016
08:58 AM
|
0
|
0
|
1628
|
|
POST
|
In Pro, you need to use something called the "Overlay". If you look at the MapView class you will see methods to manipulate the overlay. MapTools have an extension method called "AddOverlayAsync" so that you can add a sketch to the overlay as a convenience rather than getting the MapView.Active. Here is some code - I copy-pasted it out of a sample we will be providing (amongst others) to show how to work with the Overlay. The easiest way to use it is to run the MapTool template in the SDK, delete out the entire contents of the code behind generated by the maptool template, copy this code into the code behind file. Change the class name back to the default (probably MapTool1 or something like that. Please let me know if you have questions. using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; using ArcGIS.Core.CIM; using ArcGIS.Core.Geometry; using ArcGIS.Desktop.Framework.Threading.Tasks; using ArcGIS.Desktop.Mapping; namespace OverlayExamples { /// <summary> /// Show how to add a graphic to the overlay in either 2D or 3D. /// </summary> /// <remarks>Sketch a geometry. When the sketch is completed it is added to the /// overlay. When you begin sketching again or deactivate the tool the previous /// sketch is deleted</remarks> class AddOverlayTool : MapTool { private IDisposable _graphic = null; private CIMLineSymbol _lineSymbol = null; public AddOverlayTool() { IsSketchTool = true; SketchType = SketchGeometryType.Line; //Sketch a line geometry SketchOutputMode = SketchOutputMode.Map; } protected override Task OnToolDeactivateAsync(bool hasMapViewChanged) { if (_graphic != null) _graphic.Dispose();//Clear out the old overlay _graphic = null; return base.OnToolDeactivateAsync(hasMapViewChanged); } /// <summary> /// Occurs when the tool is activated. /// </summary> /// <param name="hasMapViewChanged">A value indicating if the active <see cref="T:ArcGIS.Desktop.Mapping.MapView"/> has changed.</param> /// <returns> /// A Task that represents a tool activation event. /// </returns> protected async override Task OnToolActivateAsync(bool hasMapViewChanged) { if (_lineSymbol == null) { _lineSymbol = await Module1.CreateLineSymbolAsync(); } this.SketchSymbol = _lineSymbol.MakeSymbolReference(); } protected override void OnToolMouseDown(MapViewMouseButtonEventArgs e) { if (_graphic != null) { _graphic.Dispose();//Clear out the old overlay _graphic = null; } base.OnToolMouseDown(e); } protected async override Task<bool> OnSketchCompleteAsync(Geometry geometry) { _graphic = await this.AddOverlayAsync(geometry, _lineSymbol.MakeSymbolReference()); return true; } } }
... View more
04-29-2016
08:57 AM
|
2
|
1
|
1628
|
|
POST
|
Hi Joseph, this is not supported in the API currently. It is planned for v1.4
... View more
04-29-2016
08:46 AM
|
0
|
1
|
2447
|
|
POST
|
Hi Luke, We have to edit the unique value renderer itself, once it has been made. I have provided some code below. Note: I encourage you to look at the samples for the CIM at https://github.com/esri/arcgis-pro-sdk-community-samples/tree/master/Map-Authoring/CIMExamples. I based the code snippet below on the source code in 'CreateCIMRendererFromScratch.cs'. It uses the U.S. States dataset available with the samples. internal class SetLabelsOnUniqueValueRenderer : Button { protected async override void OnClick() { var usStatesLayer = MapView.Active.Map.GetLayersAsFlattenedList().FirstOrDefault((fl) => fl.Name == "States") as FeatureLayer; if (usStatesLayer == null) { MessageBox.Show("Please add the 'States' layer to the TOC - with a 'STATE_NAME' field containing state names.", "Cannot find US States"); return; } //make a unique value renderer await CreateUniqueValueRendererOnStatesAsync(usStatesLayer); SetLabelsOnStatesRendererAsync(usStatesLayer); } private Task CreateUniqueValueRendererOnStatesAsync(FeatureLayer fl) { return QueuedTask.Run(() => { var uvrDef = new UniqueValueRendererDefinition() { ValueFields = new string[] {"STATE_ABBR"}, SymbolTemplate = SymbolFactory.DefaultPolygonSymbol.MakeSymbolReference(), //Simple ramp ColorRamp = new CIMLinearContinuousColorRamp() { FromColor = CIMColor.CreateRGBColor(0, 255, 0, 60),//Green, partially transparent ToColor = CIMColor.CreateRGBColor(255, 0, 0, 60),//Red, partially transparent ColorSpace = new CIMICCColorSpace() { URL = "Default RGB" } } }; fl.SetRenderer(fl.CreateRenderer(uvrDef)); }); } private Task SetLabelsOnStatesRendererAsync(FeatureLayer fl) { return QueuedTask.Run(() => { var renderer = fl.GetRenderer() as CIMUniqueValueRenderer; //A UniqueValue renderer has one or more CIMUniqueValueGroups. In this example //there is only one CIMUniqueValueGroup (otherwise use a 'foreach(var group in ....)' var group = renderer.Groups[0]; //Each group has one or more CIMUniqueValueClasses - in this case we have one class per //STATE_ABBR value. Note: The default value and label are on the renderer itself //(renderer.DefaultLabel, renderer.DefaultSymbol) and are NOT in a class. foreach (var valClass in group.Classes) { //Each CIMUniqueValueClass has a Label (what you are after 😉 and an array of CIMUniqueValues //As our values are unique, we have one CIMUniqueValue per class. //Get its field value (read from STATE_ABBR) and change the label to be the state name if (valClass.Values[0].FieldValues[0] == "AK") valClass.Label = "Alaska"; else if (valClass.Values[0].FieldValues[0] == "AL") valClass.Label = "Alabama"; else if (valClass.Values[0].FieldValues[0] == "AR") valClass.Label = "Arkansas"; else if (valClass.Values[0].FieldValues[0] == "AZ") valClass.Label = "Arizona"; //etc,etc } fl.SetRenderer(renderer); }); } }
... View more
04-07-2016
10:52 AM
|
0
|
1
|
1176
|
|
POST
|
Ted, try this (from http://converter.telerik.com/) Protected Overrides Sub OnToolMouseDown(e As MapViewMouseButtonEventArgs) If e.ChangedButton = MouseButton.Left Then e.Handled = True End If 'Let Framework know we want to handle MouseDown asynchronously End Sub Private _lastClickedMapPoint As MapPoint = Nothing Protected Overrides Function HandleKeyDownAsync(k As MapViewKeyEventArgs) As Task _lastClickedMapPoint = Await QueuedTask.Run(Function() ActiveMapView.ClientToMap(k.ClientPoint)) 'TODO - do something with _lastClickedMapPoint End Function Oh - I think also you are looking for the starting point - In Visual Studio, add a new project of type Module (within ArcGIS folder). In the project, right-click Add New Item, again in the ArcGIS folder pick MapTool or SketchTool.. There is more info here: https://github.com/esri/arcgis-pro-sdk/wiki/ProGuide-Build-Your-First-Add-in
... View more
03-25-2016
09:23 AM
|
1
|
0
|
2917
|
|
POST
|
The easiest way would be to create the layer using LayerFactory and then apply the symbology to the layer (you just created) using Geoprocessing.ExecuteToolAsync() and the layer file. Something like: var gpresult = await Geoprocessing.ExecuteToolAsync("ApplySymbologyFromLayer_management", new string[] {theNewLayerName,@"C:\Location\my_layer_file.lyr"}); Here are some links that might help: Apply Symbology From Layer Performing Geoprocessing Create and Add a Layer to the Active Map
... View more
03-03-2016
03:54 PM
|
0
|
1
|
1555
|
|
POST
|
Hi Luke, you might find these links helpful: Map Exploration Samples MapTool concepts
... View more
02-25-2016
08:59 AM
|
0
|
0
|
991
|
|
POST
|
Hi Ted, Good question. Comes down to priorities basically - we templatized the most commonly used controls (20 templates at 1.2) and the controls that are more obscure we did not. If lots of people want to use checkboxes or spinners on custom tabs we can look at adding templates for them. Otherwise, as you noted, just add them by hand. On the core tabs they are rarely used.
... View more
02-19-2016
11:13 AM
|
0
|
0
|
605
|
|
POST
|
Hi Luke, currently access to the item metadata you describe is not supported. We are targeting support in the API for 2016.
... View more
02-17-2016
10:42 AM
|
1
|
2
|
2725
|
|
POST
|
It's a bug at 1.1. It is fixed at 1.2. Your code looks fine.
... View more
02-12-2016
11:34 AM
|
0
|
0
|
780
|
|
POST
|
For 10x: the following SDKs are available: .NET (C#, VB) Visual C++ Java Cross Platform C++ (mostly for Linux developers) VBA is supported via the VBA Compatibility setup Additionally, Add-ins for 10x can be written using Python. This includes ICommand. (eg Python Add-ins) There are no plans to retire any of the SDKs. All SDKs will be released again at 10.4.1 same as was done at 10.4 and previously.
... View more
02-08-2016
09:55 AM
|
2
|
0
|
6816
|
|
BLOG
|
From time to time I need to delete all the Pro Add-ins off my machine - especially if I am developing/testing/debugging and end up cluttering Pro's ribbons with all kinds of Add-ins - all in varying states of completion. To do it by hand, you navigate to your C:\Users\-- your username --\Documents\ArcGIS\AddIns\ArcGISPro folder and delete all the guid-ed subfolders. That gets to be tedious so I wrote this shell script. To use it, create a .bat or .cmd file and add a shortcut to it on your desktop. Add this code into it - be sure to replace the "-- your username --" placeholder with your username. DeleteProAddins.cmd: echo off rem http://stackoverflow.com/questions/1502913/how-to-delete-all-files-and-folders-in-a-folder-by-cmd-call rem echo Executing del /q "C:\Users\-- your username --\Documents\ArcGIS\AddIns\ArcGISPro\*" echo for /d %%x in ("C:\Users\-- your username --\Documents\ArcGIS\AddIns\ArcGISPro\*") do @rd /s /q %%x del /q "C:\Users\-- your username --\Documents\ArcGIS\AddIns\ArcGISPro\*" for /d %%x in ("C:\Users\-- your username --\Documents\ArcGIS\AddIns\ArcGISPro\*") do @rd /s /q %%x echo echo Done pause
... View more
01-06-2016
05:03 PM
|
1
|
1
|
1979
|
| Title | Kudos | Posted |
|---|---|---|
| 1 | 2 weeks ago | |
| 1 | 2 weeks ago | |
| 2 | 12-17-2025 11:33 AM | |
| 1 | 12-17-2025 01:16 PM | |
| 1 | 10-14-2025 05:01 PM |
| Online Status |
Offline
|
| Date Last Visited |
Saturday
|