|
POST
|
You just need to add a new ArcGIS Pro Dockpane to your Visual Studio project, add whatever controls you want to it, and then get it to work with the rest of your code. I would say to find a Dockpane sample in the ArcGIS Pro samples and then just customize to work for your situation.
... View more
10-17-2022
06:09 AM
|
0
|
0
|
4256
|
|
POST
|
Hi. No, I have not been able to get this to work. I haven't looked at it in a while, but might re-visit this and see if having a second look at it might help.
... View more
10-17-2022
05:50 AM
|
0
|
0
|
1622
|
|
POST
|
Thanks guys. So the problem was with my CrossHairControl. Once I deleted it and created a new one, all is good. No issues with the threading. Thanks for all your help with this!!
... View more
08-02-2022
12:14 PM
|
1
|
0
|
1717
|
|
POST
|
Thanks guys. The sample code you both have given is a great help. One issue I am having is adding the crosshair using a CheckBox in my WPF Dockpane. The code seems to run, but then I get an exception saying "page can only have window or frame as parent". In my Dockpane.xaml.cs I have this (basically the same as Wolf's code), and then the exception happens after the last line runs. The code seems to be calculating the width/height ok so it seems like I can interact with the MapView. Any help is appreciated. private void chkCrossHair_Checked(object sender, RoutedEventArgs e)
{
//draw a cross-hair in centre of active map
if (MapView.Active == null) return;
var mapView = MapView.Active;
var crossHairControl = new CrossHairControl();
//use the active mapview to get the size of the mapview display
var xRatio = 0.0;
var yRatio = 0.0;
var viewSize = mapView.GetViewSize();
if (viewSize.Width != 0.0 && viewSize.Height != 0.0)
{
var xPosition = viewSize.Width / 2;
var yPosition = viewSize.Height / 2;
// now offset for 1/2 of the user control's size
xPosition -= 16;
yPosition -= 16;
xRatio = xPosition / viewSize.Width;
yRatio = yPosition / viewSize.Height;
}
// Create a MapViewOverlayControl using the user control
var mapViewOverlayControl = new MapViewOverlayControl(
crossHairControl, true, false,
false, OverlayControlRelativePosition.Center, xRatio, yRatio);
//Add to the active map view
mapView.AddOverlayControl(mapViewOverlayControl);
}
... View more
08-02-2022
07:37 AM
|
0
|
1
|
1727
|
|
POST
|
Hi, Is it possible to add a graphic to the active Map that floats in space and doesn't change position when panning the map? What I want to do is have a cross-hair type graphic centred around the centre of the map, and when the user pans around I will then use the Maps camera co-ordinate to do things with. Hopefully that makes sense. I've added graphics before, but they've always been tied to a specific location on the map, and hence move with the map when panning. I kind of want the opposite effect.
... View more
07-28-2022
06:31 AM
|
0
|
6
|
1758
|
|
POST
|
Thanks Wolf. Here is my 2.9 code that is now working. MapPoint cameraPoint = MapPointBuilder.CreateMapPoint(Camera.X, Camera.Y, Camera.SpatialReference);
var projectedPoint = GeometryEngine.Instance.Project(cameraPoint, SpatialReferences.WGS84) as MapPoint;
... View more
07-28-2022
05:57 AM
|
0
|
0
|
682
|
|
POST
|
Hi, I'm trying to get the the Lat/Long coordinates of the active MapView Camera point. I can get the Camera point in X/Y, but having trouble converting. This is how I am doing it: MapPoint cameraPoint = MapPointBuilder.CreateMapPoint(Camera.X, Camera.Y);
var projectedPoint = GeometryEngine.Instance.Project(cameraPoint, SpatialReferences.WGS84) as MapPoint; Any guidance is appreciated.
... View more
07-27-2022
12:03 PM
|
0
|
2
|
725
|
|
POST
|
Hi. It's super easy really. Just add a dockpane with a WebBrowser control in it. Then instead of opening a browser just assign the url to the dockpane WebBrowser. //Open the dockpane if it isn't already open
DockPane pane = FrameworkApplication.DockPaneManager.Find("ArcPro_DSM_Settings_Dockpane");
pane.Activate();
//Access the web control through the View
DockpaneView myView = DockpaneView.MyDockpaneView;
myView.currentUri = new Uri(@"https://www.google.com/maps/@?api=1&map_action=pano&viewpoint=" + lat + "," + lng);
myView.streetViewControl.Navigate(@"https://www.google.com/maps/@?api=1&map_action=pano&viewpoint=" + lat + "," + lng);
... View more
07-20-2022
12:44 PM
|
1
|
1
|
4440
|
|
POST
|
Unfortunately I'm still stuck at ArcGIS Pro 2.9 until our IT department pushes out the 3.0 update. What does this StreetView tool do? Years ago I created a custom StreetView tool that we are currently using. Basically you select the tool, click on the map, and then StreetView opens in either a dockpane within ArcGIS Pro, or you can choose to have it open in a separate browser window. Does this GitHub tool basically do the same thing??
... View more
07-20-2022
10:59 AM
|
0
|
1
|
3250
|
|
POST
|
Hi @Anonymous User, I'm trying to implement your code above, but with one additional level. On the features that I do NOT want to delete, I actually need to modify one of their attributes and then get out of the delete procedure. Is there a simple way of doing this? Potentially many features could be selected, so I need to accomodate for more than just one feature at a time. I'm thinking I could keep track of GUIDs and LayerNames in an array of sorts, and then deal with them at the end of the OnRowDeleted procedure, but just looking for some pro advice. I'm pretty sure this line is where I am losing my edit.....so I need to cancel the 'delete' but keep my edit....if that makes sense. args.CancelEdit(() => Task.FromResult(false)); This is what I have so far: protected void OnRowDeleted(RowChangedEventArgs args)
{
try
{
var row = args.Row;
if (CurrentlyDeletingOID != args.Guid)
{
//If this is a MAXIMO feature, just update the LifeCycleStatus field, but keep the feature
if (row.FindField("MXCREATIONSTATE") != -1)
{
//update to REMOVED and cancel the delete
row["LifeCycleStatus"] = "REMOVED";
args.CancelEdit(() => Task.FromResult(false));
}
else //if any other feature, just delete it
{
//PROCEED with the delete
args.CancelEdit(() => Task.FromResult(true));
}
CurrentlyDeletingOID = args.Guid;
}
}
catch (Exception e)
{
ArcGIS.Desktop.Framework.Dialogs.MessageBox.Show(e.ToString());
}
}
... View more
07-18-2022
12:44 PM
|
0
|
0
|
1631
|
|
POST
|
Hi, In your code above what is !CanDeleteReshape?? I'm working on something similar, to stop a delete and update some attributes instead. Thanks!
... View more
07-04-2022
11:15 AM
|
0
|
2
|
1740
|
|
POST
|
How I'm testing this is to select a bunch of features. Some that need to be deleted and some that just need to be set to "REMOVED". So far, all of the ones that need to be deleted actually get deleted, but with the "REMOVED" ones only the first one gets processed (ie. set to "REMOVED"), and then the code stops once the error message is displayed.
... View more
07-04-2022
09:46 AM
|
0
|
1
|
1505
|
|
POST
|
OK, so I kind of have something working but it only works on one Feature at a time. If I have multiple selected where I need it to just update an attribute (instead of deleting it), then I get the following message and my code stops. I'm guessing this is some sort of system message that displays once theEditor.StopOperation("STOP"); gets called. Is there a way to bypass this message?? If so, then the rest of my code would run which should re-start the delete process and catch the remaining selected items. Sort of an intentional recursive loop is what I am going for. private void Events_OnDeleteFeature(IObject obj)
{
IMap map = pMxDoc.FocusMap;
try
{
//Check to see if current obj is a Feature.
if (obj is IFeature)
{
//Cast to an IFeature
IFeature inFeature = (IFeature)obj;
ITable inTable = obj.Table;
//Look for the Maximo field and edit.
if (inFeature.Fields.FindField("MXCREATIONSTATE") != -1)
{
inFeature.set_Value(inFeature.Fields.FindField("LifeCycleStatus"), "REMOVED");
//MessageBox.Show("SET TO REMOVED");
theEditor.StopOperation("STOP");
//if there are still selected features then not all have finished deleting....go again
if (map.SelectionCount > 0)
SendKeys.SendWait("DELETE");
}
else
{
//MessageBox.Show("DELETE IT");
}
}
}
catch (Exception ex)
{
MessageBox.Show(ex.ToString(), "Error in onDeleteFeature procedure.");
}
}
... View more
07-04-2022
09:43 AM
|
0
|
0
|
1505
|
|
POST
|
Yes, there seems to be no event that fires before the delete actually happens, so I'm hoping to be able to exit out of the delete somehow. I will try the code above and see if that works. If not, then I'll start looking into other things. Thanks!
... View more
07-04-2022
05:29 AM
|
0
|
0
|
1510
|
|
POST
|
Thanks for posting that code. I will give it a try later today. Yes, I thought about creating a button, but as you said, if the operator decides to delete using another method then that does not work.
... View more
07-04-2022
05:28 AM
|
0
|
0
|
1510
|
| Title | Kudos | Posted |
|---|---|---|
| 2 | 08-18-2023 08:57 AM | |
| 1 | 04-19-2018 05:53 AM | |
| 1 | 04-13-2018 10:07 AM | |
| 1 | 04-13-2018 10:04 AM | |
| 1 | 04-13-2018 05:56 AM |
| Online Status |
Offline
|
| Date Last Visited |
02-20-2025
03:53 PM
|