Hi -
I'm trying to create an ElectricJunction feature using the ArcGIS Pro SDK. Below is a snippet of the code that creates the feature. All non-nullable fields are set, except ASSOCIATIONSTATUS and ISCONNECTED. When I hit the "CreateRow" statement I always get the error "Field is not Nullable". However, when I try to assign a value to either ASSOCIATIONSTATUS or ISCONNECTED I get the error "Field cannot be assigned" (or something similar.)
So, I'm missing something fundamental here. Any guidance would be much appreciated.
Thx,
Ed
// Create a new junction feature here
using (RowBuffer rowBuffer = junctionFC.CreateRowBuffer())
{
rowBuffer["ASSETGROUP"] = assetGroup;
rowBuffer["ASSETTYPE"] = assetType;
//rowBuffer["ASSOCIATIONSTATUS"] = 0; // Default
//rowBuffer["ISCONNECTED"] = 2;
rowBuffer["PHASESNORMAL"] = 7; // ABC
rowBuffer["PHASESENERGIZED"] = 7;
rowBuffer["PHASESSUMMER"] = 7;
rowBuffer["PHASESWINTER"] = 7;
rowBuffer["PHASESPLAN"] = 7;
rowBuffer["LIFECYCLESTATUS"] = 2; // In Service
rowBuffer["CONSTRUCTIONSTATUS"] = 5; // Existing
rowBuffer[junctionClassDefinition.GetShapeField()] = mp;
using (Feature newFeature = junctionFC.CreateRow(rowBuffer))
{
context.Invalidate(newFeature);
}
createCount++;
}
}
Solved! Go to Solution.
Happy New Year, Ed!
I'd recommend using the CreateRowBuffer(Subtype) overload; this should set all fields to their default values, even the non-user editable ones.
I hope this helps,
--Rich
Happy New Year, Ed!
I'd recommend using the CreateRowBuffer(Subtype) overload; this should set all fields to their default values, even the non-user editable ones.
I hope this helps,
--Rich
Hi Rich -
Finally got a chance to try this. Works like a champ. Thanks much!
Ed