|
POST
|
Your code, as such, looks ok. The alpha 3 snapshot likely has bugs. You should have access to the alpha 4 snapshot otherwise please re-try on 1.4 final (available dec, jan).
... View more
12-12-2016
11:35 AM
|
0
|
2
|
1577
|
|
POST
|
Benoit, this is not possible until 1.4. Then you can derive from ArcGIS.Desktop.Framework.Controls.ProWindow which will give you what you need.
... View more
11-28-2016
12:16 PM
|
1
|
0
|
792
|
|
POST
|
I cannot reproduce your error. I opened a new project with the World Topo base map. Can you change your code as follow please: (this will allow you to catch the exception): protected async override void OnClick() { try { await QueuedTask.Run.... Also, is there a base map currently drawn in your project or a blank map display? Is the map 2D or 3D?
... View more
10-31-2016
03:38 PM
|
1
|
1
|
3341
|
|
POST
|
Sounds like a timing issue. That is, running on the VM is changing the sequence of execution in the Add-in. From the exception you are making an Async call that you are not awaiting. That async call is failing when you are running on the VM (but I have no idea why). If you use the debugger and look at the inner exceptions property it may give you the actual exception that faulted the task. That said, if you do "await" the async call you can bracket it with a standard "try { } catch" block to trap the exception. I will need to see your code to assist further.
... View more
10-31-2016
08:54 AM
|
0
|
3
|
3341
|
|
POST
|
Hi Horia, so see if this helps: Basically, when trying to reverse engineer what is in the CIM - especially the symbology - it is useful to look at the XML in the debugger. So to see how the fill is handled in a polygon symbol, for example, we can use the factory to make a symbol and then disect its parts like so: CIMStroke outline = SymbolFactory.ConstructStroke(CIMColor.CreateRGBColor(0, 0, 0, trans), 2.0, SimpleLineStyle.Solid); CIMPolygonSymbol fillWithOutline = SymbolFactory.ConstructPolygonSymbol(ColorFactory.RedRGB, SimpleFillStyle.Cross, outline); var xml = fillWithOutline.ToXml(); Then we can set our breakpoint right after the line: "var xml = ....." (or right after). Now we can inspect the symbol: The basic structure is like so: An outline and two hatch fills in this case and we can inspect the hatch fills to see how they are made also. Okay, so now we will use this knowledge in our code to allow us to customize some of the symbol properties. I am using the same "Renderer From Scratch" sample as previously in the other post - https://github.com/Esri/arcgis-pro-sdk-community-samples/tree/master/Map-Authoring/CIMExamples - modifying "CreateCIMRendererFromScratch.cs": First a method to make a custom hatch fill: internal static CIMFill ConstructHatchFillEx(CIMStroke stroke, double angle, double separation, double transparency) { return new CIMHatchFill() { Enable = true, Rotation = angle, Separation = separation, LineSymbol = new CIMLineSymbol() { SymbolLayers = new CIMSymbolLayer[1] { stroke } } } ; } Second, a method to make a custom polygon symbol: internal static CIMSymbol ConstructPolygonSymbolEx(IEnumerable<CIMFill> hatchPattern, CIMStroke outline = null) { List<CIMSymbolLayer> symbolLayers = new List<CIMSymbolLayer>(); if (outline != null) symbolLayers.Add(outline); foreach (var fill in hatchPattern) symbolLayers.Add(fill); return new CIMPolygonSymbol() { SymbolLayers = symbolLayers.ToArray() }; } Now, some code that uses it: var trans = 50.0;//semi transparent CIMStroke outline = SymbolFactory.ConstructStroke(CIMColor.CreateRGBColor(0, 0, 0, trans), 2.0, SimpleLineStyle.Solid); //Some different strokes to play with var dash = SymbolFactory.ConstructStroke(CIMColor.CreateRGBColor(255, 170, 0, trans), 1.0, SimpleLineStyle.Dash); var solid = SymbolFactory.ConstructStroke(CIMColor.CreateRGBColor(255, 0, 0, trans), 1.0, SimpleLineStyle.Solid); var dashDot = SymbolFactory.ConstructStroke(CIMColor.CreateRGBColor(85, 255, 0, trans), 1.0, SimpleLineStyle.DashDotDot); //Some different hatch fills to play with //Mimic cross hatch CIMFill[] crossHatch = { ConstructHatchFillEx(dash, 0.0, 5.0, trans), ConstructHatchFillEx(dash, 90.0, 5.0, trans) }; //Mimic diagonal cross CIMFill[] diagCross = { ConstructHatchFillEx(solid, 45.0, 5.0, trans), ConstructHatchFillEx(solid, -45.0, 5.0, trans) }; CIMFill[] diagonal = { ConstructHatchFillEx(dashDot, 45.0, 5.0, trans) }; //Now we will use them var alaska = new CIMUniqueValueClass() { Values = alaskaValues.ToArray(), Label = "Alaska", Visible = true, Editable = true, Symbol = new CIMSymbolReference() { Symbol = ConstructPolygonSymbolEx(crossHatch, outline) } }; classes.Add(alaska); etc, etc. Note: I wrote a blog post on GeoNet about the CIMViewer - https://community.esri.com/groups/arcgis-pro-sdk/blog/2016/08/04/arcgis-pro-cim-viewer a sample you can download from here: https://github.com/Esri/arcgis-pro-sdk-cim-viewer There are instructions on the github on compiling it, etc. It is an Add-in. Once installed you can manually set the properties, etc. you want on the layer or map via the UI and then inspect the CIM with the CIMViewer to see which properties, etc. you need to set in your code to automate what was done with the UI.
... View more
09-30-2016
04:47 PM
|
0
|
0
|
2343
|
|
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
|
3268
|
|
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
|
3268
|
|
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
|
2343
|
|
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
|
792
|
|
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
|
1865
|
|
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
|
1865
|
|
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
|
4294
|
|
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
|
3481
|
|
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
|
3481
|
| Title | Kudos | Posted |
|---|---|---|
| 1 | yesterday | |
| 1 | 3 weeks ago | |
| 1 | 01-08-2026 02:03 PM | |
| 1 | 01-08-2026 02:15 PM | |
| 3 | 12-17-2025 11:33 AM |
| Online Status |
Offline
|
| Date Last Visited |
yesterday
|