Select to view content in your preferred language

Set ISCONNECTED field via ArcGIS Pro SDK

143
2
Jump to solution
01-02-2025 11:05 AM
EdwardBlair
Regular Contributor

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++;
}
}



Tags (1)
0 Kudos
1 Solution

Accepted Solutions
RichRuh
Esri Regular Contributor

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

View solution in original post

0 Kudos
2 Replies
RichRuh
Esri Regular Contributor

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

0 Kudos
EdwardBlair
Regular Contributor

Hi Rich -

Finally got a chance to try this.  Works like a champ.  Thanks much!

Ed

0 Kudos