code: def _writeLinks(self, links, fileObject, replaceParamFile):
          
          for link in links:
              linkType = link.type
              fileObject.write('LINK           %s\n' % link.linkNumber)
  
              # Cases
              if 'TRAP' in linkType or 'TRAPEZOID' in linkType or 'BREAKPOINT' in linkType:
                  self._writeCrossSectionLink(link, fileObject, replaceParamFile)
  
              elif linkType == 'STRUCTURE':
                  self._writeStructureLink(link, fileObject, replaceParamFile)
  
              elif linkType in ('RESERVOIR', 'LAKE'):
                  self._writeReservoirLink(link, fileObject, replaceParamFile)
  
              else:
                  log.error('OOPS: CIF LINE 417')  # THIS SHOULDN'T HAPPEN
  
              fileObject.write('\n')
docs: Write Link Lines to File Method