POST
|
Hi David, I'd recommend taking a look at this section of the map exploration ProConcepts with regards to handling mouse down in a MapTool https://github.com/ArcGIS/arcgis-pro-sdk/wiki/ProConcepts-Map-Exploration#mouse-and-keyboard-events and this sample which offers as example (In particular look at the way the BasicMapTool uses the OnToolMouseDown and HandleMouseDownAsync methods) https://github.com/Esri/arcgis-pro-sdk-community-samples/tree/6078006a3943364f2a7931b19d1eb03c8a99e1cf/Map-Exploration/BasicMapTool There are similar options for MouseUp and MouseMove on the MapTool. You could incorporate these methods into your solution. One option would be to note when a left mouse down occurs (ie set a variable - mouseDown = true), trap the mouse move (and perform some action when mousedown == true), and finally note when the mouse up occurs (and clear the mouseDown variable). You could execute the editOperation in the MouseUp if enough distance has been travelled by the mouse. I hope this gives you some ideas. Narelle
... View more
06-26-2022
09:05 PM
|
1
|
1
|
383
|
POST
|
Hi Berndt, Take a look at the following snippet. As I understand, it will achieve what you're asking for. That is, if there is an open pane for the map it will activate it. If there isn't a map pane, it will create / open one. private void ActivateOrOpenMapPane(string mapName)
{
var mapProjItem = Project.Current.GetItems<MapProjectItem>().FirstOrDefault(mp => mp.Name == mapName);
if (mapProjItem != null)
{
// is it already open? - check the open panes
var mapPane = ProApp.Panes.OfType<IMapPane>().FirstOrDefault(pane => pane.Caption == mapName);
if (mapPane != null)
{
var pane = mapPane as Pane;
pane.Activate();
}
else
{
// open a new mapPane
mapProjItem.OpenMapPaneAsync();
// OR use the following
// it does the same thing as MapProjectItem.OpenMapPaneAsync
//QueuedTask.Run(() =>
//{
// var map = mapProjItem.GetMap();
// ProApp.Panes.CreateMapPaneAsync(map);
//});
}
}
else
{
// mapName is not in the project.
}
} I apologize for the snippet "Get the Unique List of Maps From the Map Panes" crashing. At early releases of ArcGIS Pro the MapPane objects were always fully populated (that is the MapView and the Map could be accessed), however over the releases loading optimizations have taken place and now the Map on the MapView is only accessible after it has been the active MapView. This is the issue that you're seeing that is causing the crash. I will ensure that the code is removed. Please let me know if the snippet provided doesn't help. Narelle.
... View more
06-26-2022
06:28 PM
|
0
|
3
|
598
|
POST
|
Hello, Currently the API only provides the ability to geocode addresses and return locations. It is not presently possible to reverse geocode locations to obtain address results. We will add this as an enhancement to the API in a future release. Narelle
... View more
06-16-2022
04:37 PM
|
0
|
0
|
202
|
POST
|
Hi Brian, In the case where you are calling EditOperation.Modify with an inspector object that has not actually changed any attributes, then internal optimizations will see this as an empty operation and won't actually add it to the list of work to be done when EditOperation.Execute occurs. This is why the tracking fields are not updated on your feature. Tracking fields are only updated when a change (attribute or spatial) is made to the record. In addition if there is no work to be done (ie EditOperation.IsEmpty returns true), then yes, an EditOperation.Execute will return false. In your situation, you can check the EditOperation.IsEmpty property and only call EditOperation.Execute if there is work to be done. Narelle
... View more
06-01-2022
07:09 PM
|
1
|
0
|
612
|
POST
|
Hi , We don't have anything to use the prj file directly, but I believe you should be able to use the following code as the prj file contains text in the wkt format. I have wrapped the CreateSpatialReference call in a try/catch in case of error which would need to be handled. try
{
string path = @"c:\60571.prj";
var sText = System.IO.File.ReadAllText(path);
SpatialReference sr = SpatialReferenceBuilder.CreateSpatialReference(sText);
}
catch (Exception e)
{
} Regards Narelle
... View more
05-29-2022
08:06 PM
|
0
|
1
|
376
|
POST
|
Hi Bill, Looking at your code above - you are actually assigning a Coordinate3D to the geometry field in your attributes collection. You actually need to be assigning a MapPoint. A Coordinate3D is only a lightweight structure and is not the same as a MapPoint. The point feature class expects a geometry of type MapPoint. You can fix this by not casting the result of the GeometryEngine ProjectEx or Project routines to Coordinate3D but casting the result to a MapPoint. This should fix your problem. Thanks Narelle
... View more
05-23-2022
12:04 AM
|
2
|
1
|
623
|
POST
|
Hi Jonathon, You will need the ConstructPoinFromAngleDistance method on the GeometryEngine. See the following https://pro.arcgis.com/en/pro-app/latest/sdk/api-reference/topic30155.html If you're not already aware of how to work with the geometry API here's some additional content to help get you started. https://github.com/Esri/arcgis-pro-sdk/wiki/ProConcepts-Geometry Thanks Narelle
... View more
02-23-2022
05:16 PM
|
1
|
0
|
312
|
POST
|
Hi Sorry. I misunderstood where you wanted your tool to appear. Unfortunately it is not possible to add custom tools to the toolbar in the Table pane. That toolbar is not controlled by DAML; The DAML that you are referencing (esri_editing_tableSelectionGroup) refers to a group of selection tools that appears on the application ribbon. Narelle
... View more
01-27-2022
09:07 AM
|
0
|
1
|
646
|
POST
|
Hi Angela, I am not seeing any problems with inserting a button into that group of tools on the ribbon under the Table tab. Is "myCustomButton" the name of your button class or is it the daml ID of the button.? Here is a sample button defintion. Here .the damlID is "MyAddIn_MyButton". The class name is "MyButton". You should be referencing the damlID. in the insertButton tag. <button id="MyAddIn_MyButton" caption="My button" className="MyButton" loadOnClick="true" smallImage="pack://application:,,,/ArcGIS.Desktop.Resources;component/Images/GenericButtonBlue16.png" largeImage="pack://application:,,,/ArcGIS.Desktop.Resources;component/Images/GenericButtonBlue32.png">
<tooltip heading="Tooltip Heading">Tooltip text<disabledText /></tooltip>
</button> Thanks Narelle
... View more
01-26-2022
11:59 AM
|
0
|
3
|
659
|
POST
|
Hi Lesley, Unfortunately there is no SetClipGeometry method that allows you to exclude map layers from a clip geometry. However there is a property on the CIMMap object that allows you to specify the layers. The property is called LayersExcludedFromClipping. Here's a small sample of how you would use it. // find the first layer in the map
var layer = MapView.Active.Map.GetLayersAsFlattenedList().FirstOrDefault();
if (layer == null)
return;
// create a list of strings
List<string> layerUris = new List<string>();
// add the layer URI to the list
layerUris.Add(layer.URI);
QueuedTask.Run(() =>
{
// create a polygon from the current extent
var poly = PolygonBuilder.CreatePolygon(MapView.Active.Extent);
// set the clip geometry
MapView.Active.Map.SetClipGeometry(poly, null);
// get the map definition
var mapDef = MapView.Active.Map.GetDefinition();
// assign the layers to be excluded
mapDef.LayersExcludedFromClipping = layerUris.ToArray();
// set the map definition
MapView.Active.Map.SetDefinition(mapDef);
}); Let me know if you have any questions. We'll update the SetClipGeometry method to include the option to exclude layers in a future release. Thanks Narelle
... View more
01-26-2022
11:42 AM
|
1
|
1
|
448
|
POST
|
Hi Lesley, There isn't a property for directly setting label wrapping on the legend object. But you can access the property via the CIM. Here's an example of how you do it. await QueuedTask.Run(() =>
{
var layout = LayoutView.Active.Layout;
var legend = layout.FindElement("Legend") as Legend;
if (legend == null)
return;
// get the CIM definition
var def = legend.GetDefinition() as CIMLegend;
// set label wrapping to 1 inch
var labelWidthInches = 1;
// CIM stores in points, so convert
var labelWidthPoints = LinearUnit.Inches.ConvertTo(labelWidthInches, LinearUnit.Points);
// assigning a non-zero value sets the wrapping
def.LabelWidth = labelWidthPoints;
// Zero value turns off description wrapping
def.DescriptionWidth = 0;
// update the CIM definition
legend.SetDefinition(def);
}); Thanks Narelle
... View more
11-23-2021
04:11 PM
|
1
|
1
|
593
|
POST
|
Hi Karen, Just posting to confirm that these two fixes to rubbersheet were added to ArcGIS Pro 2.9. Regards Narelle
... View more
10-18-2021
07:42 AM
|
1
|
1
|
902
|
POST
|
Hi, I wanted to confirm that an UpdateOverlay overload has been added to the MapTool and MapView classes to include a reference scale parameter at ArcGIS Pro 2.9. Regards Narelle
... View more
10-18-2021
07:40 AM
|
1
|
0
|
930
|
POST
|
Hi, I wanted to confirm that additional constructors have been added to the MultipatchBuilderEx object at ArcGIS Pro 2.9 to add basic 3d shapes such as cubes, cones, spheres, diamonds, cylinders etc. Regards Narelle
... View more
10-18-2021
07:34 AM
|
0
|
0
|
739
|
POST
|
Hello, This functionality is not available via the API . There is an extremely limited attribute table API available. Regards Narelle
... View more
10-04-2021
06:06 PM
|
1
|
0
|
795
|
Title | Kudos | Posted |
---|---|---|
1 | 02-12-2019 08:59 AM | |
4 | 03-20-2024 04:31 PM | |
2 | 01-02-2024 09:00 PM | |
1 | 10-31-2023 08:54 PM | |
1 | 09-13-2023 08:56 PM |
Online Status |
Offline
|
Date Last Visited |
3 weeks ago
|