Hello,
Is there any way to write values directly to the attribute table without having to use an inspector? Some code notation would write the value to the column as soon as the polygon was created.
I have it written like this now, but it clogs me with code and slows down the application:
long oid6 = 0;
var polygOperation = new EditOperation()
{
Name = "Tvorba polygonu",
SelectNewFeatures = false
};
polygOperation.Create(polygFeatureLayer, polygonGeometry1, (oid) => { oid6 = oid; });
await polygOperation.ExecuteAsync();
var inspector6 = new Inspector(true);
inspector6.Load(polygFeatureLayer, oid6);
inspector6[Nazev] =
value1.ToString();
inspector6[vyskyt] = 0;
inspector6.Apply();
Isn't there an option like this ?:
long oid6 = 0;
var polygOperation = new EditOperation()
{
Name = "Tvorba polygonu",
SelectNewFeatures = false
};
polygOperation.Create(polygFeatureLayer, polygonGeometry1, (oid) => { oid6 = oid; }, polyCursor2.Current[Nazev]=value1, polyCursor2.Current[vyskyt] = 0);
await polygOperation.ExecuteAsync();
I'll be happy for any advice.
I am creating an application in ArcGIS Pro SDK
Thank you
David
Solved! Go to Solution.
Hi,
You can use Create with other parameters:
var polygFeatureClass = polygFeatureLayer.GetFeatureClass();
var shapeFieldName = polygFeatureClass.GetDefinition().GetShapeField();
Dictionary<string, object> attributes = new Dictionary<string, object>();
attributes.Add(shapeFieldName, polygonGeometry1);
attributes[Nazev] = value1.ToString();
attributes[vyskyt] = 0;
editOp.Create(polygFeatureClas, attributes);
Get polygon
Hi,
You can use Create with other parameters:
var polygFeatureClass = polygFeatureLayer.GetFeatureClass();
var shapeFieldName = polygFeatureClass.GetDefinition().GetShapeField();
Dictionary<string, object> attributes = new Dictionary<string, object>();
attributes.Add(shapeFieldName, polygonGeometry1);
attributes[Nazev] = value1.ToString();
attributes[vyskyt] = 0;
editOp.Create(polygFeatureClas, attributes);
Get polygon
Hello,
Thank you very much, so far it looks like it's faster.