Quantcast
Channel: Forums - ArcObjects SDKs
Viewing all articles
Browse latest Browse all 1374

issue with getFields in arcobjects snippet

$
0
0
I'm trying to use the following snippet to acquire the field values of a feature in ArcMap, but I don't have the definition for getFields(recieve error). I've tried looking at the online help for IFeatureCursor and IFields, but I'm new to arcobjects and I can't find a solution. I've added as many referneces as I can, thinking that was the problem, but no such luck. I also don't know where I specify what feature I want to use inside this code either(the remainder of this code is located at
http://edndoc.esri.com/arcobjects/9....start_code.htm "Work with the attributes of a feature class")


Code:

IFeatureCursor featureCursor = featureClass.search(null, true);
IFields fields = featureCursor.getFields();
int fieldCount = fields.getFieldCount();
for (int i = 0; i < fieldCount; i++) {
  IField fieldI = fields.getField(i);
  String fieldName = fieldI.getName();
  System.out.print(fieldName + "\t");}
System.out.println();


Viewing all articles
Browse latest Browse all 1374

Trending Articles