|
POST
|
protected override Task<bool> OnSketchCompleteAsync(Geometry geometry)
{
return QueuedTask.Run(() =>
{
try
{
ActiveMapView.SelectFeatures(geometry, SelectionCombinationMethod.New);
//string mhNum = null;
var map = MapView.Active.Map;
//var mhLayer = map.FindLayers("Manholes").FirstOrDefault(m => m.Name == "Manholes") as FeatureLayer;
// get the currently selected features in the map
var selectedFeatures = map.GetSelection();
if (selectedFeatures.Count == 0)
{
MessageBox.Show("No manhole was selected.\n\nTry selecting a manhole again.", "Warning");
}
else if (selectedFeatures.Count > 1)
{
MessageBox.Show("More than one manhole selected.\n\nTry selecting manholes again.", "Warning");
}
else
{
// get the first layer and its corresponding selected feature OIDs
var firstSelectionSet = selectedFeatures.First();
// create an instance of the inspector class
var inspector = new Inspector();
// load the selected features into the inspector using a list of object IDs
inspector.Load(firstSelectionSet.Key, firstSelectionSet.Value);
//get the value of
string mhNum = inspector["MH_NO"].ToString();
MessageBox.Show(mhNum, "Selected Manhole");
}
}
catch (Exception)
{
string caption = "Failed to select manhole!";
string message = "Process failed. \n\nSave and restart ArcGIS Pro and try process again.\n\n" +
"If problem persist, contact your local GIS nerd.";
//Using the ArcGIS Pro SDK MessageBox class
MessageBox.Show(message, caption);
}
return true;
});
} I'm building a trace tool where the user selects a manhole as the start of the the trace. I clear all selections and make the manholes layer the only selectable layer at the start. So any features selected in the map with this tool will be in the desired layer. That's how I can use var selectedFeatures = map.GetSelection(); BTW, I really don't know what the hell I'm doing.
... View more
11-26-2018
11:08 AM
|
2
|
1
|
5060
|
|
POST
|
I had the same question. I saw the RowCursor class, but thought there would be a simpler way the get an attributte for a selected feature of a specified layer. I tried both approaches but went with the Inspector. It I don't like to use RowCursors unless i'm manipulating tables. Thanks for the snippets!
... View more
11-26-2018
10:40 AM
|
0
|
3
|
5060
|
|
POST
|
This what I used in the end. public void SetDisplayField(StandaloneTable saTable, string tableName, string fieldName)
{
var mapView = MapView.Active.Map;
QueuedTask.Run(() =>
{
//Gets a list of the standalone tables in map with the name specified in the method arguments.
IReadOnlyList<StandaloneTable> tables = mapView.FindStandaloneTables(tableName);
foreach (var table in tables)
{
//Gets the list of fields from the stand alone table.
var descriptions = table.GetFieldDescriptions();
foreach (var desc in descriptions)
{
if (desc.Name == fieldName) // If field name equals "COMPDTTM"
{
//Creates variable that's equal to "COMPDTTM"
string displayName = desc.Name;
// Get's the CIM definition from the StandaloneTable
var cimTableDefinition = table.GetDefinition() as CIMStandaloneTable;
// Set DisplayField property of the cimTableDefinition equall to displayName("COMPDTTM")
cimTableDefinition.DisplayField = displayName;
// USe the SetDefinition method to apply the modified table definition (cimTableDefninition)
saTable.SetDefinition(cimTableDefinition);
// Use to check the result when debugin in break point.
var result = table.GetDefinition().DisplayField;
}
}
}
});
}
... View more
11-12-2018
06:58 AM
|
0
|
0
|
890
|
|
POST
|
I have a button that loads some standalone tables that are in a 1:M relationship classes with other layers. I want to set the DisplayField property of the related tables to the date field so my users can see the date attributes in the popups. How do I go about this? I'm at a loss on where to go from here. public void SetDisplayField(string tableName, string fieldName)
{
var mapView = MapView.Active.Map;
QueuedTask.Run(() =>
{
IReadOnlyList<StandaloneTable> tables = mapView.FindStandaloneTables(tableName);
foreach (var table in tables)
{
var cimTableDefinition = table.GetDefinition() as CIMStandaloneTable;
var displayField = cimTableDefinition.DisplayField;
}
});
}
... View more
11-08-2018
07:24 AM
|
0
|
1
|
974
|
|
POST
|
I have two feature classes that each have a relationship class separate tables of work history. Is there a way I can access the related records for a feature in the pop-up without the adding the table to the map contents (as in ArcMap)? I know I can access the related records as shown in the image below, but I would like my users to get the info straight from the pop-up. If not I will develope one, but it would same me some time not to have to.
... View more
11-07-2018
04:52 AM
|
1
|
0
|
734
|
|
POST
|
Uma, I used CreateFeatureLayer then the SetDefinitionQuery method on the layer. var slectionLayer = LayerFactory.Instance.CreateFeatureLayer(uri, mapView, 0, "Selection Layer")
selectionLayer.SetDefinitionQuery(defQuery); I noticed that the CreateFeatureLayer method has the optional parameter RendererDefinition. I couldn't find any documentation or examples on how to use this parameter to set a simple single symbol renderer. I found plenty for graduated and unique colour symbol examples. This isn't a big deal. I just used the CIMSimpleRenderer class to create a renderer then SetRenderer after the layer has loaded. Just curious how this would work since I initially wanted the layer load with the renderer set. Thanks.
... View more
10-24-2018
01:04 PM
|
0
|
1
|
1098
|
|
POST
|
I have checked with one of my Pro users and they see the same thing.
... View more
10-24-2018
11:47 AM
|
0
|
1
|
491
|
|
POST
|
Is there a simpler way to create a layer from selected features? From the research I have done I would: Get the selected feature-->create a list/array of OBJECTIDs-->Copy the layer containing the selected features --> apply a definition query based on the list of OBJECTIDs-->… This is obviously an abbreviated description, but I do not see a simpler approach.
... View more
10-22-2018
08:03 AM
|
0
|
3
|
1297
|
|
POST
|
I have already done this. I had to reauthorize them because of the renewal of our maintenance.
... View more
10-22-2018
07:20 AM
|
0
|
0
|
2818
|
|
POST
|
#02133940 is for the case created 6 months ago where the workaround was to change the service.txt file by changing the MAC address to say ANY to configure Pro licensing for a user. The analyst has not created a case for the current issue regarding extension licensing. From what I hear that's not unusual for overseas tech support analysts to NOT create a case until they are sure they can close it. And she had no idea what to do so she said she would research it.
... View more
10-17-2018
11:00 AM
|
0
|
0
|
2818
|
|
POST
|
I upgraded License Manager to 2018.0 and there was no change.
... View more
10-17-2018
04:23 AM
|
0
|
4
|
2818
|
|
POST
|
I converted 3D Analyst, Spatial Analyst, and Network Analyst extension licenses to concurrent. I authorized them on my License Server Administrator 10.6.0. I launch ArcGIS Pro 2.2.2 and the extensions aren't greyed out, but they are listed as not available. The tech support analyst is researching the problem. Any Ideas? I have had all kinds of issues with Pro licenses where I have to modify the service.txt file on the server, do installs and configs, then modify the service.text back. This is really annoying that I have to go back to ArcMap to use 3d or spatial analyst tool.
... View more
10-16-2018
10:04 AM
|
1
|
11
|
3859
|
|
POST
|
I just had one of my Users come to me with a Pixel 2 XL that just started acting like this. It worked a week ago (last time he used it). I asked him to download Firefox and test it. Web app works fine in Firefox on a Pixel 2, Chrome doesn't.
... View more
10-09-2018
01:32 PM
|
0
|
0
|
1943
|
| Title | Kudos | Posted |
|---|---|---|
| 1 | 08-02-2023 05:14 AM | |
| 1 | 09-07-2018 11:34 AM | |
| 1 | 05-17-2018 07:47 AM | |
| 1 | 10-16-2018 10:04 AM | |
| 2 | 02-22-2019 05:24 AM |
| Online Status |
Offline
|
| Date Last Visited |
08-08-2023
04:10 PM
|