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

Add program code

#1
Hi, I make standart SampleOfflineProgramming_GUI.py and when i generate robot program there are no global variables as: approach, radius, .. How can i generate program that have parameters in the head of the program, and have all addictions in robot moves.
I want to generate program and then correct parameters in generated program, no in RoboDK, because i want to make my own GUI. Thanks a lot.
#2
You can use RunInstruction to add program calls and customized code in your program.

Example:
Code:
# Add a program call or specific code in the program:
program.RunInstruction('ChangeTool(2)',INSTRUCTION_CALL_PROGRAM)
program.RunInstruction('ChangeTool(2);',INSTRUCTION_INSERT_CODE)

More information and examples here:
https://robodk.com/doc/en/PythonAPI/robo...AddProgram
  




Users browsing this thread:
1 Guest(s)