How to hide or do modifications on all objects with loop

For example,

for (i=18;kilo<19;i++){
lv_obj_add_flag(ui_Panel[i], LV_OBJ_FLAG_HIDDEN); /// Flags


i see it is pointer (lv_obj_t *) strcut but i dont know how i can do this alternative instead of writing 20 lines with lot of ifs.

lv_obj_add_flag(“”“”“”““her i want something to loop for 20 Panels)””“”“”“”", LV_OBJ_FLAG_HIDDEN));

All Panels are created with name ui_Panel1 , ui_Panel2

It could help.
Ex.

for (int i = 1; i <= 20; i++) {
    char panelName[20];
    snprintf(panelName, sizeof(panelName), "ui_Panel%d", i);
    lv_obj_add_flag(lv_obj_get_from_name(panelName), LV_OBJ_FLAG_HIDDEN);
}