POST
|
Charles, Sorry, let me clarify what I am trying to do to make sure we are talking about the same bug, and to verify that what I am trying to do wont be possible until after 2.1 I am not working in a MapTool so using the OnToolMouseDown is not an option. We have developed our own 3rd party map that runs in a docked pane. This map is unique to my plugin and has no connection to esri\arcgis at all. What I am trying to do is allow the user to click in my 3rd party map and send that 3d coordinate to the active sketch tool in ArcGIS.. Snapping is irrelevant.. also keep in mind that this is not done in a MapTool, but rather whenever the user clicks on the 3rd party(Not ESRI) map inside of my docked pane. If the active sketch tool is a polyline, it needs to insert a vertex.. If the active sketch tool is a point, it would plot a point. We accomplished this in arcmap 10.5 very easily by using this: IEditor3 editor = ArcMap.Editor as IEditor3; editor.SendPoint(worldPoint, true); It sounds like with ArcGIS Pro I need to grab the current sketch, check what type of element it is, modify it accordingly, and set the modified version as the active sketch. That is what I had attempted with the code I posted above (currently only polyline support), but as I mentioned, the point would not appear in the points property of the geometry unless there were at least 2 points in the polyline regardless of whether or not the initial point was created by the PolylineBuilder or manually through the esri Map. Hopefully an easier method can be created to mimic what was possible with 10.5, if not, I look forward to the 2.1 release. If you can think of anything else, please let me know Thanks for your time and hope that was more clear! Maury
... View more
07-14-2017
02:53 PM
|
1
|
0
|
610
|
POST
|
Charles, Any ideas when that will be released? Is there any other alternatives for sending the coordinate to the active sketch? How is the Absolute XYZ tool doing it? Thanks, Maury
... View more
07-14-2017
01:22 PM
|
0
|
2
|
610
|
POST
|
Hi Charles, Thanks for the response. I have been playing around with both GetCurrentSketch and SetCurrentSketch, however there is a few problems. First, If i am in the place polyline sketch mode and have only placed 1 vertex, the sketch geometry returned by " GetCurrentSketchAsync" returns with no points in the Points array... so there is no way to get the coordinate of the initial point that starts the polyline unless a whole segment is plotted. Also, not sure what I would do if I want to place points. QueuedTask.Run(async () =>
{
Geometry sketchGeom = await MapView.Active.GetCurrentSketchAsync();
if (sketchGeom.GeometryType != GeometryType.Polyline)
return;
//get the sketch as a point collection
var pointCol = ((Multipart)sketchGeom).Points;
if (pointCol.Count > 0 || ((Multipart)sketchGeom).PartCount > 0)
{
Polyline polyline = sketchGeom as Polyline;
//get the last point in the sketch based on its geometry type
// Crash because no points in the poly line...
var lastSketchPoint = pointCol[(sketchGeom.GeometryType == GeometryType.Polygon) ? pointCol.Count - 2 : pointCol.Count - 1];
using (PolylineBuilder pb = new PolylineBuilder(polyline))
{
try
{
LineBuilder lb = new LineBuilder(lastSketchPoint.Coordinate3D, ((MapPoint) worldPoint).Coordinate3D);
pb.AddSegment(lb);
await MapView.Active.SetCurrentSketchAsync(pb.ToGeometry());
} catch (Exception ex)
{
}
}
} else
{
// Starts a new polyline.
var sketchPolyline = new PolylineBuilder(new[] { ((MapPoint)worldPoint).Coordinate3D });
await MapView.Active.SetCurrentSketchAsync(sketchPolyline.ToGeometry());
}
});
... View more
07-14-2017
10:20 AM
|
0
|
4
|
610
|
POST
|
Basically trying to get the same functionality as the "Absolute X,Y,Z" feature when sketching (Specify an x,y,z location—ArcGIS Pro | ArcGIS Desktop ).. I want to be able to specify a coordinate and pass it to the active sketch
... View more
07-14-2017
08:41 AM
|
0
|
6
|
610
|
POST
|
In ArcMap 10.5 I could send points to the editor like so: IEditor3 editor = ArcMap.Editor as IEditor3; editor.SendPoint(worldPoint, true); Is there any way to accomplish the same thing with the ArcGIS Pro SDK? I see plenty of snippets for creating new edit operations, but I want to pass coordinates to the users active tool.
... View more
07-14-2017
07:02 AM
|
0
|
7
|
1032
|
POST
|
Sorry for my lack of terminology here as I am new to ArcGIS and ArcObjects. I have managed to create a point feature and plot it as so: IFeature feature = layerFeatureClass.CreateFeature(); IPoint p = world; feature.Shape = p; currentTemplate.SetDefaultValues(feature); feature.Store(); //Invalidate the area around the new feature editor.Display.Invalidate(feature.Extent, true, (short)esriScreenCache.esriAllScreenCaches); However, the point is rendered very small in arcmap until I cause a full refresh, then it draws it as it should. Looking at the feature extent, the width and height is 0, which makes sense since it is a point, but I am wondering if this should be higher for the redraw since the point being plotted is not a single pixel? If I change it to editor.Display.Invalidate(null, true, (short)esriScreenCache.esriAllScreenCaches); The point renders properly, but I am properly redrawing a lot of features that don't need redrawn in the process. Here is an image of whats happening Imgur: The most awesome images on the Internet
... View more
06-01-2017
08:11 AM
|
0
|
0
|
351
|
POST
|
I need to calculate some coordinates then pass the calculated coordinates to the currently active construction tool so that it will plot it on the active map. Is this possible or do I need to generate the entire feature and add it?
... View more
05-25-2017
12:26 PM
|
0
|
3
|
550
|
Title | Kudos | Posted |
---|---|---|
1 | 07-14-2017 02:53 PM |
Online Status |
Offline
|
Date Last Visited |
11-11-2020
02:24 AM
|