For example, if you only want to insert one or two commands, that's certainly not a problem. I can give you something there.
but on the other hand it can quickly become very complex. is the content to be copied always the same or does it have to be selected from a source program first?
if the latter then you should rather do it by hand, developing such a script takes a while. And I don't think you can access all the necessary data in a conventional way anyway...
Well, there is one way of doing it. The problem is your company might not allow it to be used. Microsoft Power Automate Desktop has ability to record your mouse and keyboard selection. You can create a new flow give it a name example PcdmisCopyGroup1. Have both measurement routines open with your template routine currently visible that you want to copy from. Select Power Automate record, mouse left click hold to highlight Group1 in the Edit window. Ctrl+c to copy the highlighted Group1. Select Window menu and select the other open routine at the bottom of the list. Mouse left click hold to highlight the Group you want to replace. Ctrl+v to replace that Group with Group1. Select end recording within Power Automate. I have used Power Automate to accomplish this with other software at home and I have not been able to try it with PC-DMIS yet. Microsoft Power Automate is preinstalled with Windows 11. Here is a link to learn Microsoft Power Automate
https://learn.microsoft.com/en-us/power-automate/desktop-flows/getting-started-windows-11