def SetStrucIdx(sid, index):
    s = idaapi.get_struc(sid)
    if not s:
        return 0

    return idaapi.set_struc_idx(s, index)
Change structure index
dataset/ETHPy150Open EiNSTeiN-/idapython/python/idc.py/SetStrucIdx