Get variables from simuation into python script

Hello!

Im have a gripper and want to controll it from my variables in the simulation…
How can i get a value of an integer variable from simulation into a python script.

i think is somehow like this…
comp = getComponent() #get component in which is located this script

number = comp.variablename

I am not totally sure but if you have in properties variable which is integer then you can just call her value like that.

1 Like

Yes!!
It’s works!

Now im trying to get this variable from a script of another component. You know how can i do that?

Thanks!!

app = getApplication() # access any component in the layout by name
comp = app.findComponent(“component_name”)

1 Like

thanks dude :))))))
you saved me !!!

Thanks Guys, you helped me a lot!

You know if i can take the value of a variable created in the controller map like this into a python script?

image