Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5

Create script file to run on real robot

I created a python script and simulation on RoboDK,
then used Universal Robots URP for generate program.

Generated script file:

If, Else is not include in generated script file.
How I can fix it?

Attached Files
.rdk   UR10e_sam.rdk (Size: 3.27 MB / Downloads: 187)
Generating programs from the API will output the robot commands. If you have logic or loops in your Python code, they will be evaluated at the time you run your the script for program generation.

If you have specific code to output you can use RunCode to output custom code. Example:
robodk.RunCode("if a>0")
robodk.RunCode("  ProgramA()")
robodk.RunCode("  ProgramB()")
Some post processors understand statements such as if/then/else and may adjust the syntax if needed.

Users browsing this thread:
1 Guest(s)