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

How can I use the command SimulationTime()?

#1
Question 
I'm trying to use this command on Python, but I can´t make it work
#2
What issues do you have?

SimulationTime returns the time in seconds. More information here:
https://robodk.com/doc/en/PythonAPI/robo...lationTime
#3
(05-27-2020, 01:20 PM)Albert Wrote: What issues do you have?

SimulationTime returns the time in seconds. More information here:
https://robodk.com/doc/en/PythonAPI/robo...lationTime

I define a variable:  C1=RDK.Item('C1',ITEM_TYPE_PROGRAM)
Then I run that program, after that I write this: C1.SimulationTime()
And the program send me an error: 

C1.SimulationTime() 
AttributeError: 'Item' object has no attribute 'SimulationTime'

I think I´ts because the type of the Item but I don´t know
#4
The simulation time is a global variable (not item specific). You should use it like this:
Code:
time_seconds = RDK.SimulationTime()
#5
(06-04-2020, 02:30 PM)Albert Wrote: The simulation time is a global variable (not item specific). You should use it like this:
Code:
time_seconds = RDK.SimulationTime()

I tried like that and the code send me this error:  


time_seconds = RDK.SimulationTime()
AttributeError: 'Robolink' object has no attribute 'SimulationTime'
#6
I recommend you to update RoboDK to the latest version.
  




Users browsing this thread:
1 Guest(s)