Loops are ineffective and should be avoided when possible to limit computational time and improve readability (this is not just a sofistik thing, but general for all programming)
In this case, since it’s possible to write ... bgrp 1,2,3,4 proj yy... it should also be possible to input it with an array.
does your loop have a noticeable execution time? if not, look for optimization of computing time elsewhere, and if so, I do not know the solution based on my observation, the list of values as a parameter is turned into a loop anyway.
In this project, my execution time drops from 41 sec to 4 sec after moving away from the loop, so there is significant performance increases to be had from dropping the loops!
It’s shouldn’t be an issue to apply loads using the regular groups, but depending on the group numbering and exactly which groups you wish to apply loads to, it might be difficult to apply it to the correct groups without using loops.
As such, you’ll be better off creating secondary groups prior to the load application and then applying the loads to the secondary groups.
Long story short;
the key point is to stay away from loops
I guess longer calculation is not caused by loop itself, but due to multiple n_elem-1 time area load definition.
The same could be done with prior choosing groups and then applying load without specyfing a group in area cmd:
grp 1,2,3,4
areq ref qgrp proj zz wide 500…