POST
|
Correct, the view understanding for Pro has been unified such that the code for 2D and 3D is essentially the same or very similar. For more information please take a look at the concept documentation for map exploration ProConcepts Map Exploration · Esri/arcgis-pro-sdk Wiki · GitHub
... View more
03-21-2016
01:00 PM
|
0
|
0
|
850
|
POST
|
Alexander, the information is stored as part of the renderer which is part of the layer. The way this information is stored is part of the CIM (cartographic information model). Please take a look at this code snippet to retrieve the information: var featureLayer = ActiveMapView.Map.GetLayersAsFlattenedList().OfType<FeatureLayer>().FirstOrDefault();
QueuedTask.Run(() =>
{
var cimRenderer = featureLayer.GetRenderer() as CIMUniqueValueRenderer;
var cimRotationVariable = cimRenderer.VisualVariables.OfType<CIMRotationVisualVariable>().FirstOrDefault();
var rotationInfoZ = cimRotationVariable.VisualVariableInfoZ;
var rotationExpression = rotationInfoZ.Expression; // this expression stores the field name
});
... View more
03-18-2016
01:03 PM
|
0
|
2
|
850
|
POST
|
Luke, you were stating earlier that the field remains <null>. Depending on when and where you are checking the changed attribute value the invalidate is required as Pro might be showing you a cached state of the data and unless you invalidate the cached state is considered the current state. Please do take a look at ArcGIS Pro 1.2 API Reference Guide for the overloaded Create method. We have method signatures that accept a table as an argument. A feature class is inheriting from table so you can have multiple feature classes participate in a single edit operation regardless if they are shown in the map or not. Please keep in mind that you will still need to save the edits done by the edit operation in order to be persisted in the geodatabase. The alternative is ArcGIS Pro 1.2 API Reference Guide which is new at 1.2 and is happening as a single source on the geodatabase. Thomas
... View more
03-15-2016
11:11 AM
|
0
|
0
|
2258
|
POST
|
Luke, please do take a look at the sample code again. I believe you are missing the context.invalidate call. However for just changing a single attribute using the callback approach is overkill. A single edit operation with multiple Modify calls should suffice. Thomas
... View more
03-14-2016
11:58 AM
|
2
|
2
|
2258
|
POST
|
You have a condition on the button declaration that takes precedence and is redundant if you would like to use the Command pattern. The CanOnMyCustomButtonClick in your example will take the role of the condition. Please take a look at this example https://github.com/Esri/arcgis-pro-sdk-community-samples/tree/master/Map-Exploration/FeatureSelection/FeatureSelection on the syntax and usage.
... View more
12-15-2015
12:42 PM
|
0
|
0
|
757
|
POST
|
Loic, I believe you are looking for a unique value renderer approach based on an attribute (which is what the network analyst result layer uses). Please take a look at the unique value renderer code snippet at https://github.com/esri/arcgis-pro-sdk/wiki/ProSnippets-MapAuthoring.
... View more
10-15-2015
08:54 AM
|
2
|
1
|
1063
|
POST
|
Ben, please take a look at this editing sample https://github.com/Esri/arcgis-pro-sdk-community-samples/tree/master/Editing/EventModule It does attribute changes based on editing events. It might be a good starting point and require only minor tweaking to fit your definition for 'session' and 'job'.
... View more
10-12-2015
02:32 PM
|
0
|
0
|
485
|
POST
|
or as it was pointed out to me: FeatureLayer firstLayer = MapView.Active.Map.Layers.OfType<FeatureLayer>().FirstOrDefault();
await QueuedTask.Run(() =>
{
FeatureClass fc = firstLayer.GetTable() as FeatureClass;
Geoprocessing.ExecuteToolAsync("AddField_management", Geoprocessing.MakeValueArray(fc, "FieldName", "LONG", 9));
});
... View more
10-12-2015
09:39 AM
|
1
|
3
|
3273
|
POST
|
My mistake, the first argument is the target table. using ArcGIS.Desktop.Core.Geoprocessing;
await QueuedTask.Run(() =>
{
Geoprocessing.ExecuteToolAsync("AddField_management", Geoprocessing.MakeValueArray(@"c:\temp\demo.gdb\sample", "FieldName", "LONG", 9));
}); When you are working with layers in your map this would be that way to get the location: FeatureLayer firstLayer = MapView.Active.Map.Layers.OfType<FeatureLayer>().FirstOrDefault();
await QueuedTask.Run(() =>
{
FeatureClass fc = firstLayer.GetTable() as FeatureClass;
Datastore ds = fc.GetDatastore();
string dc = ds.GetConnectionString();
if (ds is Geodatabase)
{
Geodatabase gdb = fc.GetDatastore() as Geodatabase;
string gdbPath = gdb.GetPath();
}
string name = fc.GetName();
});
... View more
10-12-2015
09:12 AM
|
1
|
4
|
3273
|
POST
|
You are not missing anything in the API. The API is designed following the data manipulation language (DML). In order to add a field you would make a call using geoprocessing such as using ArcGIS.Desktop.Core.Geoprocessing;
await QueuedTask.Run(() =>
{
Geoprocessing.ExecuteToolAsync("AddField_management", Geoprocessing.MakeValueArray("FieldName", "LONG", 9));
});
... View more
10-12-2015
08:13 AM
|
1
|
6
|
3273
|
POST
|
It is because of the type of row the arcpy.UpdateCursor is returning. Have you looked into the data access module? http://desktop.arcgis.com/en/desktop/latest/analyze/arcpy-data-access/what-is-the-data-access-module-.htm The da module offers better performance as well as a more pythonic experience. For example it is returning the rows as dictionaries. So this would work: >>> with arcpy.da.UpdateCursor("mydata", "*") as cursor:
... old = None
... for row in cursor:
... if old is not None:
... print row[0], old[0]
... old = row
... View more
09-10-2015
10:10 AM
|
1
|
1
|
1330
|
POST
|
There are probably a number of approaches. I suggest using a LineBuilder to create a LineSegment using the two points as the start and the end point. The created segment in return contains an angle property. https://pro.arcgis.com/en/pro-app/sdk/api-reference/#topic7741.html
... View more
08-25-2015
07:25 AM
|
0
|
0
|
3878
|
POST
|
Adam, if you await any of the async functions, you are essentially writing sequentially executed code. The fact that the functionality of the async methods is going of to spin up new threads or does whatever it needs to do is kind of not relevant. This line in code will not advance until the layer is generated and added to the container. await QueuedTask.Run(() =>
{
LayerFactory.CreateLayer(new Uri(Path.Combine(CoreModule.CurrentProject.DefaultGeodatabasePath, "Sample")), MapView.Active.Map);
}); You can choose not to await the XXAsync methods, however that choice depends on your code/workflow logic. One of the reasons for Pro is to free the UI thread from business logic and always stay responsive.
... View more
08-21-2015
10:09 AM
|
0
|
3
|
756
|
POST
|
Adam, here is the code to do it. The caveat here is that this approach is not recommended for versioned data. QueuedTask.Run(() =>
{
string gdbPath = CoreModule.CurrentProject.DefaultGeodatabasePath;
Geodatabase gdb = new Geodatabase(gdbPath);
var featureClass = gdb.OpenDataset<FeatureClass>("Sample");
var featureBuffer = featureClass.CreateRowBuffer();
var newFeature = featureClass.CreateRow(featureBuffer) as Feature;
newFeature.SetShape(pointGeometry);
newFeature.Store();
});
... View more
08-21-2015
08:47 AM
|
0
|
1
|
429
|
POST
|
We have 'ProSnippets' as part of the wiki at https://github.com/esri/arcgis-pro-sdk/wiki next to the concepts. You can find the geometry snippets at https://github.com/esri/arcgis-pro-sdk/wiki/ProSnippets-Geometry
... View more
08-20-2015
04:20 PM
|
1
|
1
|
1027
|
Title | Kudos | Posted |
---|---|---|
1 | 08-20-2015 07:56 AM | |
1 | 12-08-2017 12:58 PM | |
1 | 10-12-2015 09:12 AM | |
1 | 08-20-2015 04:20 PM | |
1 | 02-21-2018 10:11 PM |
Online Status |
Offline
|
Date Last Visited |
03-10-2021
02:51 PM
|