Select to view content in your preferred language

Ignore shape area/length fields

781
2
02-24-2011 08:56 AM
CarlosPiccirillo
Emerging Contributor
Hi everyone,

I am displaying fields of a layer in a combo box and do not want to include the ESRI generated fields, OID, Shape_Area, etc.

I can easily pick out the OID and geometry fields by using the esriFieldType enumerator, but I cannot do the same for Shape_Area, Shape.Area, etc. because they are field type double and there might be other fields of the same type that I want to show.

I know I can exclude them if I get the name of each field but the shape area and length fields are called different things depending on the data type, Shape.Area, Shape_Area, Shape, etc. I am hoping there is a more elegant way of doing it. I am programming in C# but code in any language will work as I can convert it to what I need.

Thanks,
Carlos


 if (pLayerFields.get_Field(i).Type == esriFieldType.esriFieldTypeOID)
0 Kudos
2 Replies
NeilClemmons
Honored Contributor
The names of the special fields are given by the IFeatureClass interface properties AreaField, LengthField, OIDFieldName, and ShapeFieldName.
0 Kudos
CarlosPiccirillo
Emerging Contributor
Thanks a lot Neil, that's exactly what I needed! Never used those properties before.

Carlos
0 Kudos