|
POST
|
Yes, this would be the correct approach. You can take a look at this sample: https://github.com/Esri/arcgis-pro-sdk-community-samples/tree/master/Framework/ConfigWithMap you might want to remove the customization of the Ribbon UI code in ConfigurationManagerWIthMap.cs: protected override void OnUpdateDatabase(XDocument database)
... View more
08-28-2020
11:47 AM
|
2
|
0
|
1171
|
|
POST
|
Hi Kory, Without seeing you code, the only thing that comes to mind is that a dispatch timer will actually ensure that timer events are called on the dispatch thread. So first thing i would remove is this: await System.Windows.Application.Current.Dispatcher.Invoke(async () =>
... View more
08-26-2020
12:45 PM
|
1
|
0
|
1134
|
|
POST
|
Hi Jan, I just tried this using release 2.6 and it is working for me. In my test I have a feature layer that is joined to a table (both the feature layer and the table are in the TOC). I retrieve the feature layer for the query from the map using: var featureLayer = MapView.Active.Map.Layers.OfType<FeatureLayer>().Where (l => l.Name.Equals (...)); In my sample I only query the selected features, however, I see all values including the values of the joined table: QueryFilter qf = new QueryFilter()
{
ObjectIDs = featureLayer.GetSelection().GetObjectIDs()
};
using (var rowCursor = featureLayer.Search(qf))
{
while (rowCursor.MoveNext())
{
using (var anyRow = rowCursor.Current)
{
foreach (var fld in anyRow.GetFields().Where(fld => fld.FieldType != FieldType.Geometry))
{
// includes all 'joined' field names
var fieldName = fld.Name; // fld.AliasName
}
foreach (var fld in anyRow.GetFields().Where(fld => fld.FieldType != FieldType.Geometry))
{
// get all field values
var fieldValue = (anyRow[fld.Name] == null) ? string.Empty : anyRow[fld.Name].ToString();
}
}
}
}
... View more
08-24-2020
08:21 AM
|
2
|
2
|
3105
|
|
POST
|
I think the snippet in my sample did it. var lineLayerName = "TestLines";
var lineLayer = MapView.Active.Map.GetLayersAsFlattenedList().OfType<FeatureLayer>().Where(fl => fl.Name.Equals(lineLayerName, StringComparison.OrdinalIgnoreCase)).FirstOrDefault();
... View more
08-21-2020
12:21 PM
|
0
|
1
|
3225
|
|
POST
|
You are using indexof to find the layer by name. Did you validate the returned feature layer? indexof can return > 0 for any name that starts with "GISWRKS1.WORKS.WaterMain"
... View more
08-21-2020
11:04 AM
|
2
|
3
|
3225
|
|
POST
|
And the tool has snapping turned on too: UseSnapping = true;
... View more
08-21-2020
10:51 AM
|
0
|
5
|
3225
|
|
POST
|
Hi Brian, I would take a look at the 'snapping' settings in your add-in. You should see snapping enabled when you activate the tool - so with my sample I see this under the crosshair cursor: If you can't see the 'snapping' indicator, look at all 'snapping' settings in my add-in sample code. Actually I think Vertex and Intersection snapping are not really needed (this was copy/paste inheritance). public SnapPointsToLine()
{
IsSketchTool = true;
UseSnapping = true;
SketchType = SketchGeometryType.Line;
SketchOutputMode = SketchOutputMode.Map;
}
protected override Task OnToolActivateAsync(bool active)
{
var lineLayerName = "TestLines";
var lineLayer = MapView.Active.Map.GetLayersAsFlattenedList().OfType<FeatureLayer>().Where(fl => fl.Name.Equals(lineLayerName, StringComparison.OrdinalIgnoreCase)).FirstOrDefault();
if (lineLayer != null)
{
Snapping.IsEnabled = true;
Snapping.SetLayerSnapModes(lineLayer, SnapMode.Vertex, true);
Snapping.SetLayerSnapModes(lineLayer, SnapMode.Edge, true);
Snapping.SetLayerSnapModes(lineLayer, SnapMode.Intersection, true);
}
return base.OnToolActivateAsync(active);
}
... View more
08-21-2020
10:32 AM
|
0
|
0
|
3225
|
|
POST
|
Hi Brian, I made a small sample add-in that includes your method and was not able to duplicate your problem. I attached the sample (please make sure to run the "pro fix references" tool to fix the Pro assembly references before you build). When I run the sample with UseSnapping set to true, I can't get IntersectsLayer to fail. With snapping off, I can see IntersectsLayer return false which is expected. I am using overlay graphics to allow zooming in closely into the start point area to see if the watermain line and start point intersect: The sample requires a TestLines feature class since i used the C:\Data\FeatureTest sample data from community samples.
... View more
08-21-2020
09:29 AM
|
0
|
2
|
3225
|
|
POST
|
You can find the information you're looking for here: ProConcepts Content and Items · Esri/arcgis-pro-sdk Wiki · GitHub In code it would look like this (needless to say you can drop the pmi==null check in your code): IProjectItem mapX = ItemFactory.Instance.Create(@"c:\temp\TheMap.mapx") as IProjectItem;
IProjectMultiItem pmi = mapX as IProjectMultiItem;
if (pmi == null) MessageBox.Show("Does not implement IProjectMultiItem");
else Project.Current.ImportItem(pmi, false);
... View more
08-20-2020
10:02 AM
|
1
|
1
|
1203
|
|
POST
|
I attached another sample. You have to use the 'Pro Fix References' tool in Visual Studio in order to fix the references: With this add-in you can digitize a point, which is then converted into a vertical line, which is then in turn displayed as a graphic using different colors, and a custom width. The vertical 'tubes' are both above and below the surface.
... View more
08-19-2020
11:52 AM
|
1
|
1
|
1999
|
|
POST
|
Hi Sean, You can take a look at this sample, it implements some of the functionality that you are looking for: https://github.com/Esri/arcgis-pro-sdk-community-samples/tree/2d6a30e2597c7a0079ae65b182f60a77e79aaef7/Map-Exploration/IdentifyWindow
... View more
08-18-2020
01:08 PM
|
1
|
1
|
2863
|
|
POST
|
I am still not sure what type of feature you are trying to symbolize. But you can do this using ArcGIS Pro out-of-box by using for example a 3D line feature class. I attached a sample project. This would be the 'above' surface view: and this would be the below surface view:
... View more
08-18-2020
10:07 AM
|
0
|
3
|
1999
|
|
POST
|
Hi Than, Can you please explain your requirements in more detail? You have a scene in ArcGIS Pro and you are trying to change a feature layer's Z values? Can you describe your workflow? i.e. take a line, polygon and 'move' the polygon below the surface?
... View more
08-17-2020
08:58 PM
|
0
|
0
|
1999
|
|
POST
|
Hi Sai, The solution is a bit complicated but in essence you need to set the mapcontrol's map extent as follows. This approach requires that the MapControl's aspect ratio is fixed: Create a rectangle with your given line as the centerline, with the rectangle having the MapControl's aspect ratio. Now you need to compute another rectangle that is centered around the given line's center point and this rectangle cannot intersect the rectangle from step 1 (in essence the step 2 rectangle has to fit inside the rectangle from step 1). To compute this rectangle I am using the step 1 rectangle's extent in order to intersect either diagonal with the step 1 rectangle. Set the MapControl's extent using the extent of the step 2 rectangle. In the screenshot below you can see the rectangle created in step 1 with a cyan colored outline, the rectangle in step 2 is marked by the two red corner point markers. The cyan rectangle is also displayed in the overlay window. I attached my code and data. In order to build the code you have to first use the 'Pro Fix References' tool. When running the add-in you have to first use the map control tool to click the desired line (to be displayed horizontally in the overview window) and then click the "Step 1" button which executes the algorithm explained above. Please use the attached 'Lines.zip' project file because it contains both sample lines and a polygon layer used for debug purposes.
... View more
08-15-2020
10:20 PM
|
0
|
1
|
2443
|
|
POST
|
Hi Brian, I think using the ListBox on a different thread might be causing this issue. To work around this i would try: var whereClause = $@"FACILITYID = '{lstFacIDs.SelectedItem}'";
QueuedTask.Run(() =>
{
QueryFilter qf = new QueryFilter()
{
WhereClause = whereClause
};
gsFLayer.Select(null, SelectionCombinationMethod.Add);
}); Also note that when you call gsFLayer.ClearSelection() that this (depending on your implementation) can cause a change in your listbox content.
... View more
08-14-2020
09:18 AM
|
2
|
1
|
1804
|
| Title | Kudos | Posted |
|---|---|---|
| 1 | 10-29-2025 10:48 AM | |
| 1 | 05-24-2021 09:04 AM | |
| 1 | 12-03-2020 08:44 AM | |
| 1 | 10-07-2025 07:27 AM | |
| 2 | 12-29-2025 10:03 AM |
| Online Status |
Offline
|
| Date Last Visited |
05-21-2026
01:59 PM
|