Design Sequence diagrams with code (not blocks or visuals)

Is there anyway i can design a sequence diagram using code (not any visual diagrams). need to pass some data to the arrows of the diagram and the diagram should be iterated over a loop, like multiple diagrams.

Yes. @SilverFire used for such purposes as far as I remember.