def METHOD_NAME(self, name: str, prefix: str, nlimit: int=500) -> int:
    """
    Helper method for `create_groups_by_visible_result` and `create_groups_by_property_id`
    """
    #eids = self.find_result_by_name('ElementID')
    #elements_pound = eids.max()
    try:
        eids = self.gui.groups['main'].element_ids
        elements_pound = self.gui.groups['main'].elements_pound
    except Exception as error:
        self.gui.log.error('Cannot create groups as there are no elements in the model')
        self.gui.log.error(str(error))
        if self.gui.IS_GUI_TESTING:
            raise
        return 0
    result = self.gui.find_result_by_name(name)
    ures = np.unique(result)
    ngroups = len(ures)
    if ngroups > nlimit:
        self.gui.log.error('not creating result; %i new groups would be created; '
                           'increase nlimit=%i if you really want to' % (ngroups, nlimit))
        return 0
    for uresi in ures:
        ids = np.where(uresi == result)[0]
        name = '%s %s' % (prefix, uresi)
        element_str = ''
        group = Group(
            name, element_str, elements_pound,
            editable=True)
        group.element_ids = eids[ids]
        self.gui.log_info('creating group=%r' % name)
        self.gui.groups[name] = group
    return ngroups