how can i use robot to make component merge sth and split them(NO Works Process or Process).
Or use robot to make component Invisible or visible,so i can simulate material loading and unloading。
how can i use robot to make component merge sth and split them(NO Works Process or Process).
Or use robot to make component Invisible or visible,so i can simulate material loading and unloading。
I may have found a way, but how to connect the robot to the Python Script?
I used a stupid way to do it with delay。
from vcScript import *
app = getApplication()
comp = getComponent()
def OnRun():
while app.Simulation.IsRunning:
comp.Visible = True
delay(392)
comp.Visible = False
delay(71)
comp.Visible = True
delay(71)
comp.Visible = False
I hope someone can give me a better way
Make a custom robot program statement or a custom robot signal action.
I’m in touch with Python Script for the first time today. Can you be more specific,thanks!
Oh, I found some cases
while robot.SignalMapIn.input(0) != True:
robot.callSubRoutine(“***”)
I mean that you can either add your own signal actions to the robot, as those are just implemented by a Python script in the robot component that you can override to extend or modify the actions. There should be an “action script” snippet in the Python script editor if I recall correctly.
Basics of using signal actions: Signal Grasp and Release Actions | Visual Components Academy
Another approach is to make your own statements that can be used in the robot programs. These can be implemented with Python as well. It is also possible to make custom statements using a .NET add-on but those then need to be installed by each user while the Python-based custom statements will be saved with the simulation layout.