I want to calculate a string field for 223 selected points with text 'PVT' plus a sequential number like 'PVT0001' then 'PVT0002' and so forth. What is the most efficient way to do this?
That doesnt really make sense as the field calculator wont work iteratively in that fashion. To be honest, create your 00001, 00002 in excel when concatenate with 'PVT' and paste the field into your table.
I really am not a fan of using Python global in this context, but since you have already started down this path the easiest way to get what you want is to change the final line of the code in your screenshot:
<SPAN class="keyword token">return</SPAN> <SPAN class="string token">"PVT{:05}"</SPAN><SPAN class="punctuation token">.</SPAN>format<SPAN class="punctuation token">(</SPAN>rec<SPAN class="punctuation token">)</SPAN><SPAN class="line-numbers-rows"><SPAN></SPAN></SPAN>
Angemeldete Mitglieder können Beiträge verfassen, Updates folgen und mehr. Neu hier? Registriere ein kostenloses Konto.
Find useful guides, FAQs, and documents to help you navigate and make the most of Esri Community.