嗨,杰里米,谢谢你的帮忙,your solution seems to work! I set the linked robot for all subprograms to one robot, export the main program for that same one, and the Python file contains all subfunctions with all commands; exactly what I needed. Two things:
1) Changing the linked robots does however mess up the simulation (understandably). So after exporting, the linked robot for every single subprogram would need to be manually reset in order to go back to simulation. With a RoboDK model incorporating all robots and mechanisms in a station ready, I think RoboDK could be the right program to enable an operator to easily design new motions, and export the plan for use in the real world. To make this done easily indeed, is there a script available to change the linked robot for all subprograms and back, so the operator wouldn't have to change any of these?
2) To facilitate re-linking the commands in the Python file to the right robot/mechanism controller, I could incorporate the names of the specific robot to the name of the subprograms, e.g Rob1_goHome, Rob1_doTrick, Rob2_goHome, Rob2_doTrick, Mech1_goHome, Mech1_doSinus, etc. Do you see another way to provide this information in the Python file of which command belongs to which robot/mechanism, not using the name of the subprogram but somehow including the name of the intended linked robot/mechanism?
We plan to put this in practice in a few months, so if any development is going on on this topic it would be helpful for me to know. Either on mentioned scripts or perhaps a dedicated export function that gets rid entirely of the suggested work-arounds.
Thanks again, Maarten.
Another option would be a script to export the main function consecutively for each individual robot/mechanism, without changing the linked robot/mechanism in the subprograms. Multiple output files would then be created, one for each robot/mechanism, from which the required information would need to be collected and combined.
1) Changing the linked robots does however mess up the simulation (understandably). So after exporting, the linked robot for every single subprogram would need to be manually reset in order to go back to simulation. With a RoboDK model incorporating all robots and mechanisms in a station ready, I think RoboDK could be the right program to enable an operator to easily design new motions, and export the plan for use in the real world. To make this done easily indeed, is there a script available to change the linked robot for all subprograms and back, so the operator wouldn't have to change any of these?
2) To facilitate re-linking the commands in the Python file to the right robot/mechanism controller, I could incorporate the names of the specific robot to the name of the subprograms, e.g Rob1_goHome, Rob1_doTrick, Rob2_goHome, Rob2_doTrick, Mech1_goHome, Mech1_doSinus, etc. Do you see another way to provide this information in the Python file of which command belongs to which robot/mechanism, not using the name of the subprogram but somehow including the name of the intended linked robot/mechanism?
We plan to put this in practice in a few months, so if any development is going on on this topic it would be helpful for me to know. Either on mentioned scripts or perhaps a dedicated export function that gets rid entirely of the suggested work-arounds.
Thanks again, Maarten.
Another option would be a script to export the main function consecutively for each individual robot/mechanism, without changing the linked robot/mechanism in the subprograms. Multiple output files would then be created, one for each robot/mechanism, from which the required information would need to be collected and combined.