|
POST
|
Let me test this. The only difference I see is that I am using BasicFeatureLayer. Not sure why though. I think the example I was following used that class. Now that I look at the differences, the FeatureLayer class has more methods. So let me change to that class and test again.
... View more
08-22-2022
04:15 PM
|
0
|
0
|
2589
|
|
POST
|
@GKmieliauskas that is exactly what I have in my original post. It doesnt work. I also posted the error.
... View more
08-22-2022
09:04 AM
|
0
|
0
|
2604
|
|
POST
|
Unfortunately it didn't work. I have been trying for 2 days to get this to work and its a bit disappointing to me that at Pro 3.0 that geometry objects are not supported with geoprocessing. At least the ones I have tested. This is what ended up working for me after numerous tests (why are we still relying on strings when we have classes and objects?): //clear the origin layer of ALL selections
SelectedOriginLayer.ClearSelection();
//select ONLY the origin feature in the origin layer
var qf = new QueryFilter();
qf.WhereClause = "FID=1";
Selection selOrigin = SelectedOriginLayer.Select(qf, SelectionCombinationMethod.New);
//clear the proximity layer of ALL selections
SelectedProximityLayer.ClearSelection();
//gp
List<string> vals= new List<string>();
vals.Add(SelectedProximityLayer.URI); //in_layer: the selection will be applied to this layer
vals.Add("WITHIN_A_DISTANCE_GEODESIC"); //overlap_type: we want features within a geodesic distance
vals.Add(SelectedOriginLayer.URI); //select_features: this is the source (the original)
vals.Add("100 NAUTICALMILES"); //search_distance: search within 100 NM of the source
vals.Add("NEW_SELECTION"); //selection_type: new selection
vals.Add("NOT_INVERT"); //invert_spatial_relationship: do not invert selection
IGPResult gpResult = await Geoprocessing.ExecuteToolAsync("SelectLayerByLocation_management", vals);
... View more
08-21-2022
03:37 PM
|
0
|
2
|
2637
|
|
POST
|
After looking at the documentation and my prior work with ArcMap I see where I erred. The parameter Selecting Features is defined as a Feature Layer and I was trying to pass it a Feature object. All I had to do was select my feature in the layer and pass it the layer like so: //clear the origin layer of ALL selections
SelectedOriginLayer.ClearSelection();
//select ONLY the origin feature in the origin layer
var qf = new QueryFilter();
qf.WhereClause = "FID=1";
Selection selOrigin = SelectedOriginLayer.Select(qf, SelectionCombinationMethod.New);
//clear the proximity layer of ALL selections
SelectedProximityLayer.ClearSelection();
//gp
List<object> values = new List<object>();
values.Add(SelectedProximityLayer); //in_layer: the selection will be applied to this layer
values.Add("WITHIN_A_DISTANCE_GEODESIC"); //overlap_type: we want features within a geodesic distance
values.Add(SelectedOriginLayer); //select_features: this is the source (the original)
values.Add("100 NAUTICALMILES"); //search_distance: search within 100 NM of the source
values.Add("NEW_SELECTION"); //selection_type: new selection
values.Add("NOT_INVERT"); //invert_spatial_relationship: do not invert selection
var parameters = Geoprocessing.MakeValueArray(values);
IGPResult gpResult = await Geoprocessing.ExecuteToolAsync("SelectLayerByLocation_management", parameters);
... View more
08-21-2022
11:38 AM
|
0
|
3
|
2641
|
|
POST
|
With Pro 3.0 I am trying to implement the SelectLayerByLocation geoprocessing tool. I have objects/classes that I want to pass in to the tool. I've looked at the community samples and the ESRI forums and I must be missing something because this throws an exception System.InvalidOperationException HResult=0x80131509 Message=convert unsupported type Source=ArcGIS.Desktop.GeoProcessing object[] listOfParameter = { SelectedProximityLayer, "WITHIN_A_DISTANCE_GEODESIC", featOrigin, "100 NAUTICALMILES", "NEW_SELECTION", "NOT_INVERT" };
var parameters = Geoprocessing.MakeValueArray(listOfParameter); //exception here
var gpResult = await Geoprocessing.ExecuteToolAsync("SelectLayerByLocation_management", parameters); With ArcMap you could call out a native .NET API to do this and I can't find anything similar with Pro: Dim selLyrLoc As New SelectLayerByLocation
selLyrLoc.in_layer = pPointProxLayer 'the selection will be applied to this layer
selLyrLoc.overlap_type = "WITHIN_A_DISTANCE_GEODESIC" 'we want features within a geodesic distance
selLyrLoc.select_features = pFeatSelOrigin 'this is the source feature
selLyrLoc.search_distance = "100 NAUTICALMILES" 'search within 100 NM of the source
selLyrLoc.selection_type = "NEW_SELECTION" 'new selection
selLyrLoc.invert_spatial_relationship = "NOT_INVERT" 'do not invert selection
'run the geoprocessor
Dim res As ESRI.ArcGIS.Geoprocessing.IGeoProcessorResult = CType(GP.Execute(selLyrLoc, Nothing), ESRI.ArcGIS.Geoprocessing.IGeoProcessorResult) I see that the parameter list is a string list but how do I feed my objects /classes to any geoprocessing tool?
... View more
08-20-2022
03:58 PM
|
0
|
9
|
2683
|
|
IDEA
|
As detailed in this post: https://community.esri.com/t5/arcgis-pro-sdk-questions/light-dark-logo-image-in-prowindow/m-p/1197457 I added a ProWindow to my project and the ViewModel class was not added. DockPanes and PropertySheets get the ViewModel class added automatically. Is this by design? If not, I think It would be helpful if it was added in an update.
... View more
08-17-2022
11:17 AM
|
1
|
2
|
1168
|
|
POST
|
Woot!!! I got it to work. Two things that were messing me up: 1. The missing ViewModel which is not created by the VS extension. I had to create my own ViewModel class and then reference that in the ShowProWindow class. 2. The path to the image. I was under the impression that I needed to provide the namespace of the project in the path. That didn't work so I tried just the name of the project and that worked. //"pack://application:,,,/ArcGIS.Desktop.Resources;component/Images/GenericButtonPurple16.png"
url = @"pack://application:,,,/MyProject;component/Images/logo.png";
... View more
07-29-2022
07:20 AM
|
0
|
0
|
3301
|
|
POST
|
@UmaHarano thank you very much for the sample. One thing I did notice was that when I add a ProWindow through the VS 2022 Extension I do not get a ViewModel. Since I'm kind of newish to WPF I just thought it wasnt needed. DockPanes and PropertySheets get the ViewModel class added automatically. Is this by design?
... View more
07-29-2022
06:23 AM
|
0
|
1
|
3301
|
|
POST
|
Hmm I've tried every permutation of URI and it just wont work. here is what I currently have for the two URIs: url = @"pack://application:,,,/MyCompany.MyGroup.MyAddin;component\Images\logo_hrz_grd.png";
url = @"pack://application:,,,/MyCompany.MyGroup.MyAddin;component\DarkImages\logo_hrz_grd.png"; and my xaml <Image RenderTransformOrigin="-1.82,-1.377" Source="{Binding LogoImageSource}" HorizontalAlignment="Left" VerticalAlignment="Top" Height="39" Width="214" Margin="5,9,0,0" Stretch="Fill"/> ill try again tomorrow.
... View more
07-28-2022
03:58 PM
|
0
|
1
|
3312
|
|
POST
|
Yes I did but thats way too much overhead for my project. All I have is just one image I have to switch and that's it.
... View more
07-28-2022
11:57 AM
|
0
|
0
|
3326
|
|
POST
|
I have looked at several posts and the samples but cant seem to find an easy way to add a logo image to my ProWindow. . Currently I have Images/logo_hrz.png and DarkImages/logo_hrz.png and they are both set as Resource and Do Not Copy. But I am struggling to tell the SDK to load the resource depending on the Pro Theme: <Image RenderTransformOrigin="-1.82,-1.377" Source="{DynamicResource logo_hrz}" HorizontalAlignment="Left" VerticalAlignment="Top" Height="39" Width="214" Margin="5,9,0,0" Stretch="Fill"/>
... View more
07-28-2022
09:30 AM
|
0
|
9
|
3342
|
|
POST
|
@Wolf thanks! I looked through the API and Samples and couldn't find a way to ignore zoom. But thanks for the code snippet as it will work for now. I was thinking about the same thing...basically take a snapshot of the extent, CreateLayer, then zoom back to saved extent.
... View more
07-27-2022
12:14 PM
|
0
|
0
|
808
|
|
POST
|
In updating my code to the Pro 3.0 SDK I see that there is now a new way to add a FeatureClass to the map. So I went through and refactored my code block to this: //add the feature class to the map
//https://github.com/Esri/arcgis-pro-sdk/wiki/ProConcepts-3.0-Migration-Guide#arcgisdesktopmappingdll
var lyrParams = new FeatureLayerCreationParams(grdFeatClass) { MapMemberPosition = MapMemberPosition.AddToTop };
var featLayer = LayerFactory.Instance.CreateLayer<FeatureLayer>(lyrParams, mv.Map); Works great but I also noticed that it ALWAYS zooms in to the layer. I have custom zooming logic that is basically NoZoom or ZoomWithPadding. I would like to just have the CreateLayer not do any zooming at all and let me apply it -OR- not apply it. Anyway of doing this?
... View more
07-24-2022
01:36 PM
|
1
|
2
|
895
|
| Title | Kudos | Posted |
|---|---|---|
| 1 | 04-25-2020 09:25 PM | |
| 1 | 08-17-2022 11:17 AM | |
| 1 | 07-24-2022 01:36 PM | |
| 1 | 07-14-2022 11:22 AM | |
| 1 | 07-14-2022 10:29 AM |
| Online Status |
Offline
|
| Date Last Visited |
10-27-2025
11:11 AM
|