Theoretical Python question. Say you have an update cursor while-loop for a few selected records. While looping through the rows, at some point a nested if statement triggers an "addfield" event. The rows are meant to continue to loop as normal. Is it the case that a newly added field for a feature class is not selected in the feature layer and therefore omitted in the update cursor? Can you run addfield on a feature selection layer rather than feature class to resolve this issue, i.e. gp.addfield("featlyr", name, "TEXT") where featlyr is gp.MakeFeatureLayer("somefc", "featlyr"); gp.SelectLayerByAttribute("featlyr", etc); cursor = gp.UpdateCursor("featlyr").

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.