code: def addElement(self, *ele):
          
          for el in list(Models.flatten(ele)):
              e = copy.deepcopy(el)
              self._lattice_eleobjlist.append(e)
              self._lattice_elenamelist.append(e.name)
              self._lattice_elecnt += 1
          # update lattice, i.e. beamline element
  
          # self._lattice.setConf(Models.makeLatticeString(self._lattice_elenamelist))
          self._lattice.setConf(Models.makeLatticeDict(self._lattice_elenamelist))
  
          # positioning elements
          self.initPos()
  
          return self._lattice_elecnt
docs: add element to lattice element list
  
              :param ele: magnetic element defined in element module
              return total element number