|
POST
|
I took a look at the colors I generated in the code. The Color Editor looks correct in my scenario: var trans = 50.0;//semi transparent var alabamaColor = CIMColor.CreateRGBColor(255, 170, 0, trans);
... View more
09-30-2016
11:57 AM
|
2
|
1
|
2533
|
|
POST
|
Horia, can you look at this sample please: https://github.com/Esri/arcgis-pro-sdk-community-samples/tree/master/Map-Authoring/CIMExamples It shows how to make a unique renderer from scratch (in this code behind - CreateCIMRendererFromScratch.cs) I modified it as follows: This seems to work ok for me. It makes a unique value renderer on a US States dataset. var trans = 50.0;//semi transparent var alabamaColor = CIMColor.CreateRGBColor(255, 170, 0, trans); CIMStroke outline = SymbolFactory.ConstructStroke(ColorFactory.BlackRGB, 2.0, SimpleLineStyle.Solid); var alabama = new CIMUniqueValueClass() { Values = alabamaValues.ToArray(), Label = "Alabama", Visible = true, Editable = true, Symbol = new CIMSymbolReference() {Symbol = SymbolFactory.ConstructPolygonSymbol(alabamaColor, SimpleFillStyle.Solid, outline) } }; classes.Add(alabama); etc, etc
... View more
09-30-2016
11:38 AM
|
1
|
1
|
2533
|
|
POST
|
Horia, it looks like the outline is missing from your symbol. Take a look at this: https://github.com/esri/arcgis-pro-sdk/wiki/ProSnippets-MapAuthoring#how-to-construct-a-polygon-symbol-of-specific-color-fill-style-and-outline I am not sure about your transparency issue. I will take a look at this.
... View more
09-30-2016
10:50 AM
|
0
|
2
|
1962
|
|
POST
|
Ted, try this: https://github.com/esri/arcgis-pro-sdk/wiki/ProSnippets-Geodatabase#opening-an-enterprise-geodatabase-using-sde-file-path
... View more
09-16-2016
10:33 AM
|
0
|
0
|
621
|
|
POST
|
Clarification: >>>In the case of two or more Add-ins referencing a copy of the same assembly, the first Add-in to ~load~ will load that assembly<<< In the case of two or more Add-ins referencing a copy of the same assembly, the first Add-in to ~use~ that assembly will load that assembly.
... View more
09-02-2016
03:29 PM
|
1
|
0
|
1542
|
|
POST
|
Hi Karl, In the case of two or more Add-ins referencing a copy of the same assembly, the first Add-in to load will load that assembly. Even though the referenced assembly has been copied to 2 places (i.e. two different assembly cache folders), it will only be loaded once (by the first Add-in that uses it). With a "mega" Add-in then only one copy of the referenced library is deployed (rather than individual copies per Add-in) but that doesn't change the assembly loading behavior as such but this may or may not be more practical to manage. On the question of "Shared Add-ins" on the Add-in Manager backstage tab: Same as with 10x, additional add-in folders (beyond the default user add-in folder) can be specified via the registry from which Add-ins are loaded. These folders can be specified for all users of the machine (via HKLM) or just a specific user (HKCU). This is documented here. Add-ins loaded from Add-in folders specified under the HKLM Add-in folders key are considered "shared" and show up in that list.
... View more
08-30-2016
01:14 PM
|
1
|
0
|
1542
|
|
BLOG
|
The CIMViewer can be used to examine layer and map (2D or 3D) CIM definitions in Pro. Select a layer, map, or scene in the TOC with the viewer open and its CIM definition will be loaded into the XML Editor. The XML Editor uses the AvalonEdit control which provides syntax colorization and formatting. Cut, Copy, Paste, and XML Validation have been added in the Add-in so the XML editing experience is reasonably functional though not as rich as a fully fledged commercial editor like XML Spy. However, it is a simple task of copy/pasting the CIM XML into a commercial editor if that level of XML manipulation is desired. The Save button will save any changes you make back to the layer, map, or scene whose CIM definition you loaded. However, there is not much of a safety net to protect you against making really bad xml or other inadvertant mistakes so use the Save functionality with caution. The primary use of the CIM Viewer is to allow you, the developer, to decipher the inner workings or "guts" of the CIM and how it affects the configuration of your Pro project at any given point in time. In other words, it is a learning or educational tool that can be used to help you in your Pro development efforts and is not a customization or configuration tool. The CIM Viewer is at https://github.com/Esri/arcgis-pro-sdk-cim-viewer You will need the AvalonEdit and Extended.Wpf.Toolkit NuGets to compile and build the CIM Viewer. The NuGet package.config is included with the project so these should download automatically when you attempt to build. If your Visual Studio is not configured to automatically download and install NuGets you can use the Visual Studio NuGet Package Manager to do it by hand. (You don't have the NuGet Package Manager installed? Find it Here, You are not familiar with NuGets? Watch this tutorial.)
... View more
08-04-2016
01:09 PM
|
6
|
0
|
4068
|
|
POST
|
You will have to maintain a list of the graphics you add. Each call to AddOverlay returns an IDisposable. When you dispose that disposable the graphics associated with it are cleared. A convenient place to cache the graphics is your Module (something like internal static List<IDisposable> MyGraphics { ..... }). See https://github.com/Esri/arcgis-pro-sdk-community-samples/tree/master/Map-Exploration/OverlayExamples
... View more
08-02-2016
02:31 PM
|
2
|
1
|
2642
|
|
POST
|
I suggest moving this bit outside of the QueuedTask.Run lambda: var parameters = Geoprocessing.MakeValueArray( outPath, layerName, "Polygon", null, "No","No", DeltaLayer.Map.SpatialReference.Wkid); //var env = Geoprocessing.MakeEnvironmentArray(workspace: workspaceName); var cts = new CancellationTokenSource(); await Geoprocessing.ExecuteToolAsync("management.CreateFeatureClass", parameters, null, cts.Token, (eventName, o) => { switch (eventName) { case "OnValidate": if (((IGPMessage[])o).Any(it => it.Type == GPMessageType.Warning || it.Type == GPMessageType.Error)) { { var errorsOrWarnings = ((IGPMessage[])o).Where(it => it.Type == GPMessageType.Error).ToArray(); if (errorsOrWarnings.Any()) { var e = errorsOrWarnings.Select(err => err.Text).ToArray(); MessageBox.Show(string.Join(@" ", e)); cts.Cancel(); } } } break; } });
... View more
08-02-2016
01:20 PM
|
0
|
0
|
2642
|
|
POST
|
So I tried two scenarios. I could not reproduce your issues. I am using a File GDB, all local data. Projection is WebMercator. Scenario1: I created a point layer that included the end points of an underlying line feature class as well as mid points. There are a total of 9 points (I had 3 lines originally). I used the Buffer GP Tool to buffer the points and add the result to the map. I changed the symbol using a SimpleRenderer. There is a noticeable pause on the first GP call. Say 4 or 5 seconds. Subsequent calls take about 1 second. No flickering. Scenario2: I extracted all the Geometries from the point layer. I made a MultiPoint. I buffered the Multipoint using GeometryEngine.Buffer. I added the output polygon (from the buffer) to the Graphic Overlay. This was almost instantaneous. You could improve the performance by caching the geometry and not querying the layer each time (if the point layer was not changing in your session). //This is Scenario 1 using the GP internal class ButtonScenario1 : Button { internal static int _count = 1; protected async override void OnClick() { var pointsLayer = MapView.Active.Map.GetLayersAsFlattenedList().First( l => l.Name == "Points_For_Lines"); var layerName = $@"Points_Buffer{_count++}"; var valueArray = Geoprocessing.MakeValueArray(pointsLayer, $@"E:\Scratch\TestBuffer\TestBuffer.gdb\{layerName}", "50 meters"); await Geoprocessing.ExecuteToolAsync("analysis.Buffer", valueArray); var buffer_layer = MapView.Active.Map.GetLayersAsFlattenedList().First( l => l.Name == layerName) as FeatureLayer; //set the renderer to something different than the default await QueuedTask.Run(() => { var outline = SymbolFactory.ConstructStroke(ColorFactory.BlueRGB, 2.0, SimpleLineStyle.Solid); var circleSymbol = SymbolFactory.ConstructPolygonSymbol(ColorFactory.GreyRGB, SimpleFillStyle.Solid, outline); var srdef = buffer_layer.GetRenderer() as CIMSimpleRenderer; srdef.Symbol = circleSymbol.MakeSymbolReference(); buffer_layer.SetRenderer(srdef); }); } } //This is Scenario 2 using the Overlay internal class ButtonScenario2 : Button { private IDisposable _graphic = null; private CIMPolygonSymbol _polySymbol = null; private Geometry _bufferResult = null; protected async override void OnClick() { if (_graphic != null) { _graphic.Dispose();//Clear out the old overlay _graphic = null; } if (_polySymbol == null) { _polySymbol = await CreatePolygonSymbolAsync(); } //we will use a Geometry in this example var pointsLayer = MapView.Active.Map.GetLayersAsFlattenedList().First( l => l.Name == "Points_For_Lines") as FeatureLayer; await QueuedTask.Run(() => { var mpBuilder = new MultipointBuilder(pointsLayer.GetSpatialReference()); var cursor = pointsLayer.GetFeatureClass().Search(); while (cursor.MoveNext()) { mpBuilder.Add(((Feature) cursor.Current).GetShape() as MapPoint); } //Can be cached safely if the Geometry is not changing var mp = mpBuilder.ToGeometry(); var buff = GeometryEngine.Buffer(mp, 50.0); _graphic = MapView.Active.AddOverlay(buff, _polySymbol.MakeSymbolReference()); }); } internal static Task<CIMPolygonSymbol> CreatePolygonSymbolAsync() { return QueuedTask.Run(() => { var outline = SymbolFactory.ConstructStroke(ColorFactory.BlueRGB, 2.0, SimpleLineStyle.Solid); return SymbolFactory.ConstructPolygonSymbol(ColorFactory.GreyRGB, SimpleFillStyle.Solid, outline); }); } }
... View more
08-01-2016
05:57 PM
|
2
|
0
|
2642
|
|
POST
|
Right, no I get what you are trying to do, the distinction I was trying to make in my original comment was that View Models created as Pro Framework elements -eg a View Model that is subclassed from ArcGIS.Desktop.Framework.Contracts.DockPane - (another example I gave was an embedded control but there are others) are created and managed by Pro - their lifecycle, datacontext, the whole smash. There are no substitutes (eg GalaSoft) for what Pro does via its Framework and no dependency injection for those classes. Now, if you had custom content, say a User Control and an associated proprietary View Model, that you wanted to re-use on "X" Dockpanes (eg - in the UserControl hosted on a Pro Dockpane you had a content provider to which you were binding your custom control) then this would be a relationship that you would manage as you wish within the limitations of Add-ins, etc.. I guess that was what I was trying to say. Of course, as you state, you can not create the "parent" "Pro" Dockpane and its user control (to which your custom User Control was bound) in a Unit Test scenario, or otherwise.
... View more
07-28-2016
05:53 PM
|
0
|
0
|
2172
|
|
POST
|
Dockpane is the correct way to go. The best you can do on the docking is dock to the application window (left, right, top, bottom) - it does not support docking to a Pane (map, layout, etc) as you mention. Conceptually, Pro has an Active pane (the one with focus). The TOC (amongst other things) keys off this and changes its contents to match whichever pane is active. Therefore, when you try to use a Pane (and not a ~dock~ pane), even though you get the docking behavior you want, activating your Pane de-activates the previously active pane (eg a map) and the TOC, seeing that ~your~ pane is not a mapview, it empties. There are special cases in Pro where the context needs to be maintained even though a MapView does not have focus. For example, if you open a layer attribute table the TOC remains unchanged and the MapView.Active property is still valid. In this case, the table pane instance (hosting the attribute table) is providing the proper context to the TOC (for the mapview that contains the layer whose attributes are being shown) to keep the TOC populated. However, the code to do that is all internal and is not exposed in the API. Currently there are no plans to support this.
... View more
07-28-2016
03:57 PM
|
0
|
5
|
2991
|
|
POST
|
Can you provide more information please: How many points in the collections and what is the size of the buffer? I will try and reproduce. I am assuming that there are no exceptions? That the code executes without failing (GP succeeds, Renderer definition is good, renderer is set with no errors)? Also: it is not possible to change the buffer symbol.
... View more
07-28-2016
03:44 PM
|
0
|
2
|
2642
|
|
POST
|
I am not sure I understand the reference to MVVM Light and ViewModelLocator??......however, the closest thing to that construct would be the DockpaneManager class and FrameworkApplication.DockPaneManager.Find("the id of the dockpane"). The returned DockPane is your ViewModel instance and it is a singleton. This pattern is also repeated in other aspects of Pro. For example, an Embedded Control if you are using such in a Map Tool, can be accessed via a MapTool's OverlayEmbeddableControl property: which also returns your ViewModel - again, a singleton. These are view models created by Framework from the definitions added to your Config.daml. You cannot create them. If you are referring to a ~custom~ view model - one that you are making rather than one defined in your Config.daml - then you are responsible for instantiating and passing that guy around. To make a property, method, instance, etc globally available within your Add-in you must add such a method or property to your Module class (to which all objects in your Add-in have access)
... View more
07-28-2016
03:38 PM
|
0
|
2
|
2172
|
|
POST
|
I can reproduce the tool behavior. Looks like a bug. Ideally, the developer could choose how he/she wants their tool to behave - either complete the sketch on MouseUp or require a second click. In part, this behavior is being inherited from the base class which is more geared for editing (rather than selection) where individual clicks (eg for digitizing) are required. Unfortunately you are getting a bit of both - one click the first time, two clicks subsequently. We will look at this for 1.4. I will speak with the developers about the possibility of a "popup window closed" event.
... View more
07-12-2016
02:58 PM
|
1
|
0
|
5102
|
| 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
|