POST
|
When I click Uninstall, I get an error, and it seems like the uninstall failed because the Uninstall button is still enabled. The error says "while trying to restore package" but that message didn't appear until I clicked Uninstall.
... View more
05-14-2019
11:03 AM
|
0
|
0
|
878
|
POST
|
After I execute MapView.Active.GetFeatures(someGeometry), I get a dictionary of feature layers and OIDs in those feature layers that match the search geometry. From there, how do I get the actual features so I can read their attributes? Do I have to assemble the OIDs into a where clause for a query filter search, or is there a more direct way such as the IFeatureClass.GetFeature method from the ArcGIS for Desktop SDK?
... View more
05-10-2019
08:02 PM
|
0
|
7
|
8092
|
POST
|
According to the docs, the visualintersect argument of the GetFeatures method Indicates whether only features that visibly intersect the geometry should be returned. What does "visibly intersect" mean? Is there a difference between visibly intersecting something and actually intersecting something?
... View more
05-10-2019
07:22 PM
|
0
|
2
|
868
|
POST
|
I opened the solution for the CrowdPlannerTool sample in VS 2017. As expected, VS tells me a NuGet package is missing. Step 4 of the instructions says to install the package using Install-Package System.Windows.Controls.DataVisualization.Toolkit When I try this, I get:
PM> Install-Package System.Windows.Controls.DataVisualization.Toolkit
Install-Package : Some NuGet packages are missing from the solution. The packages need to be restored in order to build the dependency graph. Restore the packages before
performing any operations.
At line:1 char:1
+ Install-Package System.Windows.Controls.DataVisualization.Toolkit
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : InvalidOperation: (:) [Install-Package], InvalidOperationException
+ FullyQualifiedErrorId : NuGetMissingPackages,NuGet.PackageManagement.PowerShellCmdlets.InstallPackageCommand Can anyone help me get this sample up and running? Thanks!
... View more
05-10-2019
02:50 PM
|
0
|
2
|
1054
|
POST
|
Using a string instead of a uri also works for me. Add(new GalleryItem("Item Text", "pack://application:,,,/MyDefaultNamespace;component/Thumbnails/my_png_image.png"));
... View more
05-07-2019
02:57 PM
|
0
|
0
|
1326
|
POST
|
When a user activates a map tool, I want to prompt them for a folder using FolderBrowserDialog. As soon as the dialog opens, the application hangs. To simplify this test, I also tried just showing a message box. The message box shows, but then the application hangs, and I cannot click OK on the message box or interact with the rest of Pro. Is there a way to prompt the user during OnToolActivateAsync? protected override Task OnToolActivateAsync(bool hasMapViewChanged)
{
MessageBox.Show("Now we are stuck");
return base.OnToolActivateAsync(hasMapViewChanged);
} Environment: Windows 10 Visual Studio 2017 Community Edition Pro SDK for .NET (and Utilities) 2.3.0.15769 Pro 2.3.2
... View more
05-02-2019
01:47 PM
|
0
|
0
|
388
|
POST
|
In ArcGIS Pro, I can only click a particular item from my custom gallery once. If I click the gallery drop down and click the same item again, nothing happens. Here's the OnClick: protected override void OnClick(GalleryItem item)
{
ArcGIS.Desktop.Framework.Dialogs.MessageBox.Show(item.Text);
base.OnClick(item);
} I put a breakpoint in the code on the message box line, and it hits it the first time I click an item but not the second. However, if I click a different gallery item, then the breakpoint is hit (but not if I click that second gallery item again). When I compile the gallery sample, I get the same behavior. To reproduce the bug: 1. Download and build the gallery sample (under Framework/Gallery). 2. Start Pro and click a web map from the gallery. It is added to your project. 3. Delete the map and click the same web map in the gallery again. No map is added this time. What's the trick to handling when a user clicks on a gallery item they've clicked before? Environment: Windows 10 Visual Studio 2017 Community Edition Pro SDK for .NET (and Utilities) 2.3.0.15769 Pro 2.3.2
... View more
05-02-2019
10:27 AM
|
0
|
5
|
1234
|
POST
|
Using a Uri helped, and it also appears that the pack URI needed to use my default namespace rather than the module id. Here's my updated snippet which works, using a correct Pack URI and a Uri object. Thanks Uma Harano! Add(new GalleryItem("Item Text", new Uri("pack://application:,,,/MyDefaultNamespace;component/Thumbnails/my_png_image.png")));
... View more
05-02-2019
08:56 AM
|
1
|
2
|
1326
|
POST
|
I also tried hard-coding an image path on disk, but the image is still missing when I click the gallery drop down in the ribbon. var img = Image.FromFile(@"C:\my_images\my_png_image.png");
Add(new GalleryItem("Item Text", img)); Maybe I'm missing something about the requirements for images to be used for a gallery item? That img is definitely not null when I pass it to the GalleryItem constructor.
... View more
04-30-2019
10:16 AM
|
0
|
0
|
1326
|
POST
|
I have my own images I created for use as a gallery item icons within my gallery. In the Initialize() method of my Gallery, I want to do this in C#: // I already added my image to Properties.Resources
var img = new Bitmap(Properties.Resources.my_png_image);
Add(new GalleryItem("Item Text", img)); However, when I click the Gallery in the ribbon, I see the text but no image. What's the proper way to include an image in your project and use it as the icon for a gallery item? I don't have to use Properties.Resources; that's just one thing I tried. I also tried using images as embedded resources, using an image I added to my Thumbnails folder with Build Action set to Resource, but the resource stream (the stm variable) came back null. I also tried using images as resources, but I got a "Could not load file or assembly" error on this line: BitmapImage fromResource = new BitmapImage(new Uri("pack://application:,,,/Module1;component/Thumbnails/my_png_image.png", UriKind.Absolute));
... View more
04-30-2019
10:06 AM
|
0
|
5
|
1479
|
POST
|
I resolved my problem by setting "Embed Interop Types" to False for all ESRI.ArcGIS references. You can select all of those references in the solution explorer and change that property all at once. However, I didn't see an ADF error in my list though I do have a reference to ESRI.ArcGIS.ADF, so I suspect this will not solve the original post.
... View more
03-04-2016
01:27 PM
|
1
|
0
|
1107
|
POST
|
In my testing, running the add-in compiled for 10.3 works in ArcMap 10.4. However, some of my customers require the add-in to be compiled against the version of ArcGIS that they are actually using.
... View more
03-04-2016
12:19 PM
|
0
|
1
|
1107
|
POST
|
When I tried to build, I got hundreds of errors related to the numerous type changes between 10.3 and 10.4 [1]. Seems similar to your ADF missing type error. I didn't see a utility to update the types in Visual Studio 2013. Is there an automated way to do this? [1] https://desktop.arcgis.com/en/arcobjects/latest/net/webframe.htm#d018a65d-574a-4964-a72c-77f16d1c4319.htm
... View more
03-04-2016
09:47 AM
|
0
|
3
|
1107
|
POST
|
I just tested in 10.1 and had the same result as Robert: No exception was thrown, but FixedAspectRatio remained true even after setting it to false. However, I also found that the legend was able to adjust its width and height properties correctly without my intervention, so my solution of programmatically updating the size of the element containing the legend is no longer necessary in ArcGIS 10.1.
... View more
07-24-2014
12:17 PM
|
0
|
0
|
871
|
POST
|
I see the source of confusion. I should have provided more code in my example. Below is a more fully fleshed-out example, showing how the legend is initialized by creating a MapSurroundFrame with UID "esriCarto.Legend". Today I also discovered that I needed to add the element to the layout after I'm finished working with the legend. Otherwise, if I mess with the legend and try to reassign its geometry, the new geometry doesn't stick. It keeps the original one. // Initialize a legend for the focus map
IGraphicsContainer gc = ArcMap.Document.PageLayout as IGraphicsContainer;
IActiveView av = gc as IActiveView;
IMap map = av.FocusMap;
IMapFrame mapFrame = gc.FindFrame(map) as IMapFrame;
ESRI.ArcGIS.esriSystem.IUID uid = new ESRI.ArcGIS.esriSystem.UIDClass();
uid.Value = "esriCarto.Legend";
IMapSurroundFrame mapSurroundFrame = mapFrame.CreateSurroundFrame((ESRI.ArcGIS.esriSystem.UID)uid, null);
// Size it
IQuerySize querySize = mapSurroundFrame.MapSurround as IQuerySize;
Double w = 0;
Double h = 0;
querySize.QuerySize(ref w, ref h);
Double aspectRatio = w / h;
IEnvelope envelope = new EnvelopeClass();
// The legend is anchored with bottom left corner at x=1, y=2
// Not sure why aspect ratio matters -- just following Esri's example
envelope.PutCoords(1, 2, (1 + 1), (2 + 1 / aspectRatio));
IElement element = mapSurroundFrame as IElement;
element.Geometry = envelope;
// Get the legend object and do something with it
ILegend2 legend = mapSurroundFrame.MapSurround as ILegend2;
// ... some work ... now assume the legend size has changed
// Update size of element containing the legend
querySize.QuerySize(ref w, ref h);
// Convert from points to page units, e.g., inches
w = av.ScreenDisplay.DisplayTransformation.FromPoints(w);
h = av.ScreenDisplay.DisplayTransformation.FromPoints(h);
envelope.PutCoords(1, 2, (1 + w), (2 + h));
element.Geometry = envelope;
// Now add the element to the layout.
// If you add it earlier, from my experience, sometimes
// the new geometry you assign doesn't stick
gc.AddElement(element, 0);
... View more
06-30-2014
07:52 AM
|
0
|
0
|
1374
|
Title | Kudos | Posted |
---|---|---|
1 | 05-11-2020 11:56 AM | |
3 | 06-03-2021 09:16 AM | |
2 | 12-13-2020 12:16 PM | |
1 | 12-02-2020 12:11 PM | |
1 | 06-05-2019 06:55 AM |
Online Status |
Offline
|
Date Last Visited |
09-05-2024
06:00 PM
|