What have you done already to achieve this? You can programmatically model diagrams using the modeling API only.