'Gets elements based on the type, which is function from text.py, draw.py etc.'

def getElementsByType(self, element):

    obj = element(check_grammar=False)
    if (self.element_dict == {}):
        self.rebuild_caches()
    return self.element_dict.get(obj.qname, [])
