|
POST
|
//I am assuming the selected item is a north arrow
var northArrow = LayoutView.Active.GetSelectedElements().First();
QueuedTask.Run(() =>
{
//CIMTopoNorthArrow is a different beast entirely...
var cim = northArrow.GetDefinition() as CIMMarkerNorthArrow;
//this halo symbol is 50% transparent, no outline (i.e. 0 width)
((CIMPointSymbol)cim.PointSymbol.Symbol).HaloSymbol = SymbolFactory.Instance.ConstructPolygonSymbol(
SymbolFactory.Instance.ConstructSolidFill(ColorFactory.Instance.CreateRGBColor(0,0,0,50)),
SymbolFactory.Instance.ConstructStroke(ColorFactory.Instance.BlackRGB,0));
((CIMPointSymbol)cim.PointSymbol.Symbol).HaloSize = 3;//size of the halo
//set it back
northArrow.SetDefinition(cim);
});
... View more
06-14-2018
01:47 PM
|
0
|
2
|
2868
|
|
POST
|
Hi Emily, Progress dialog boxes are disabled when debugging via Visual Studio. That might be why you are not seeing the cancelable progressor. Try running your add-in outside of the debugger. Note: Dockpanes are not actually destroyed when you close them (I assume you mean "Dockpane" when you say "form"?) - they are hidden. "Opening" them just makes them visible again. FYI, if you haven't had a chance to look at it yet - this document goes into the gory details of cancelation: ProConcepts Framework#progress-and-cancelation....(I also add the link to this comment for other readers of your thread)
... View more
06-14-2018
12:37 PM
|
0
|
1
|
2540
|
|
POST
|
EventLog is intended for logging when Pro is in diagnostic mode otherwise writing to the log is a no-op. ArcGIS Pro runs in diagnostic mode using the "/enablediagnostics" command line switch. ProConcepts-Framework#diagnostic-mode-event-logging. Output goes to an xml file in My Documents\ArcGIS\Diagnostics If you want your logging always "on" (not just when Pro is in diagnostic mode) then using another logger is the way to go
... View more
06-13-2018
10:36 AM
|
3
|
0
|
2975
|
|
POST
|
Brian, just change your test from "IndexOf" to "==" or string.Compare. Currently, you are testing for any layer that contains the string "GISWRKS1.WORKS.ForceMain" which is not what you want. p.s. As an alternative, you can also include lambdas in most all LINQ extensions if you want to make your statements more concise...[for example Where(x => x == 1).FirstOrDefault() versus FirstOrDefault(x => x == 1)] https://stackoverflow.com/questions/8059285/c-sharp-linq-whereexpression-firstordefault-vs-firstordefaultexpression
... View more
06-13-2018
10:21 AM
|
0
|
0
|
1384
|
|
POST
|
I cannot reproduce Ted. Somewhere the style or brush is getting overwritten. If you'd like me to debug you'll have to get the Add-in code to me
... View more
05-23-2018
11:32 AM
|
0
|
0
|
868
|
|
POST
|
Ted, you have something else going on. When I put your xaml directly into a Dockpane it looks fine. I am thinking your UserControl is part of a larger UI on a dockpane? If so, somewhere along the line, in one of your user control parents, I suspect the underlying foreground color for the default TextBlock style is getting overwritten or, less likely, the Foreground color itself (brush, technically speaking) is getting overwritten. Paste this xaml into the bottom of your StackPanel and see how it looks on your UserControl... <TextBlock Style="{DynamicResource Esri_TextBlockRegular}" Margin="0,10,0,0"
Text="Esri_TextStyleDefaultBrush" VerticalAlignment="Center"
Foreground="{DynamicResource Esri_TextStyleDefaultBrush}"/>
<Rectangle Width="200" Height="30" Fill="{DynamicResource Esri_TextStyleDefaultBrush}"/>
<TextBlock Style="{DynamicResource Esri_TextBlockRegular}"
Text="Esri_Gray170_Brush" VerticalAlignment="Center"
Foreground="{DynamicResource Esri_Gray170_Brush}"/>
<Rectangle Width="200" Height="30" Fill="{DynamicResource Esri_Gray170_Brush}"/> This is what I see...(the red box and arrow are mine - not in the xaml). See, on your dockpane, if the text and rectangle colors ~match~ your original text color (dim) or do not match (bright). I am thinking that both the text and boxes will look ok (bright).
... View more
05-23-2018
10:25 AM
|
0
|
0
|
4302
|
|
POST
|
Thanks Mark. We've added this as an issue for our next release after 2.2.
... View more
05-16-2018
09:40 AM
|
0
|
6
|
2226
|
|
POST
|
>>Can you programmatically set the position/width/height of a floating dockpane, or can this only be controlled in the DAML file? You set the docking behavior in the DAML. You cannot set an explicit position >>Is there a way I can reset the position so it reappears at the center of the screen? No
... View more
05-07-2018
10:33 AM
|
0
|
2
|
3150
|
|
POST
|
Try using the path to the FeatureServer itself. You should get a parent composite layer ("group") that contains all of the individual layer end points (however many there are). LayerFactory.Instance.CreateLayer(new Uri("http://....url here.../FeatureServer", UriKind.Absolute), MapView.Active.Map);
... View more
05-07-2018
10:27 AM
|
1
|
1
|
1055
|
|
POST
|
"esri_editing_EditVerticesRotate" is a button (i.e. "command") not a tool. Try this instead: //elsewhere
private ICommand _rotate = null;
//Do work, process sketch, etc.
//ArcGIS.Desktop.Framework.FrameworkApplication.SetCurrentToolAsync(
// "esri_editing_EditVerticesRotate");
//activate rotate
if (_rotate == null)
_rotate =
FrameworkApplication.GetPlugInWrapper("esri_editing_EditVerticesRotate") as ICommand;
if (_rotate.CanExecute(null))
{
_rotate.Execute(null);
}
I am not sure why you are deadlocking. FrameworkApplication.SetCurrentToolAsync would be a no-op in your case because the tool "esri_editing_EditVerticesRotate" does not exist.
... View more
05-01-2018
01:57 PM
|
1
|
0
|
856
|
|
POST
|
Try this. internal class CreateScaleBar : Button
{
protected async override void OnClick()
{
var arcgis_2d = Project.Current.GetItems<StyleProjectItem>().First(si => si.Name == "ArcGIS 2D");
var layout = LayoutView.Active.Layout;
StringBuilder sb = new StringBuilder();
await QueuedTask.Run(() =>
{
var scaleBarStyle = arcgis_2d.SearchScaleBars("Imperial Double Alternating Scale Bar").First();
Coordinate2D coord = new Coordinate2D(1.5, 0.5);
MapFrame mf = layout.FindElement("Map Frame") as MapFrame;
var scalebar = LayoutElementFactory.Instance.CreateScaleBar(layout, coord, mf, scaleBarStyle);
//customize
var cimdef = scalebar.GetDefinition() as CIMDoubleFillScaleBar;
//divisions
cimdef.Divisions = 3;//1 for the sub-divisions and two others
cimdef.Subdivisions = 2;
//text - division labels
var textCim = SymbolFactory.Instance.ConstructTextSymbol(
ColorFactory.Instance.BlueRGB, 12, "Verdana", "Regular");
cimdef.LabelSymbol = textCim.MakeSymbolReference();
//unit label - "Miles"
cimdef.UnitLabelSymbol = textCim.MakeSymbolReference();
//number format (I have no idea what some of these do so feel
//free to fiddle - I just set everything...)
cimdef.NumberFormat = new CIMNumericFormat()
{
AlignmentOption = esriNumericAlignmentEnum.esriAlignLeft,
AlignmentWidth = 10,
RoundingOption = esriRoundingOptionEnum.esriRoundNumberOfDecimals,
RoundingValue = 1,
ShowPlusSign = false,
UseSeparator = true,
ZeroPad = false
};
//with the CIM you ~must~ set the definition back!
scalebar.SetDefinition(cimdef);
});
}
}
... View more
04-24-2018
05:40 PM
|
0
|
1
|
2264
|
|
POST
|
Refer to my response on your scale bar question. https://community.esri.com/message/766351-create-a-double-fill-scale-bar?et=watches.email.thread. Change scale bars for North arrows. e.g. var northArrowItems = arcgis_2d.SearchNorthArrows(""); North arrows are style items not fonts in Pro (even though there are esri fonts that contain north arrow characters)
... View more
04-24-2018
10:39 AM
|
0
|
1
|
2982
|
|
POST
|
The problem is the style item. CreateScaleBar wants a ScaleBarStyleItem that will come from the project style file. By default this will be "ArcGIS 2D". You can see the available styles (in ArcGIS 2D) for scalebars when you use the "Scale Bar" button on the Insert tab. Let's first look at listing out the ScaleBarStyleItems from the project style: var arcgis_2d = Project.Current.GetItems<StyleProjectItem>().First(si => si.Name == "ArcGIS 2D");
StringBuilder sb = new StringBuilder();
await QueuedTask.Run(() =>
{
//Imperial Double Alternating Scale Bar
//Metric Double Alternating Scale Bar
//or just use empty string to list them all...
var scaleBarItems = arcgis_2d.SearchScaleBars("Double Alternating Scale Bar");
foreach (var sbi in scaleBarItems) {
sb.AppendLine($"{sbi.Name}, {sbi.Category}, {sbi.Key}");
}
});
System.Diagnostics.Debug.WriteLine(sb.ToString()); Now let's use one of the Double Alternating Scale Bar styles to create a scale bar: var scaleBarStyle = arcgis_2d.SearchScaleBars("Imperial Double Alternating Scale Bar").First();
Coordinate2D coord = new Coordinate2D(10.0, 7.0);
MapFrame mf = layout.FindElement("Map Frame") as MapFrame;
LayoutElementFactory.Instance.CreateScaleBar(layout, coord, mf, scaleBarStyle);
... View more
04-23-2018
03:46 PM
|
0
|
3
|
2264
|
|
POST
|
The finished sketch is returned to you in the OnSketchCompleteAsync callback.
... View more
04-20-2018
12:38 PM
|
0
|
1
|
1576
|
| Title | Kudos | Posted |
|---|---|---|
| 1 | 05-19-2026 10:29 AM | |
| 1 | 04-29-2026 02:06 PM | |
| 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 |
3 weeks ago
|