Page 1 of 1

LUA to Python

Posted: 31 Jul 2022, 11:05
by fkaraal
Hello,

"modelHandle=sim.getObjectAssociatedWithScript(sim.handle_self)"

what is the equivalent of this line in python?

Re: LUA to Python

Posted: 01 Aug 2022, 12:43
by coppelia
Hello,

you can use exactly the same from a child script and Python. If you however try to run this from an external python script, this won't work (and doesn't make any sense, since an external script doesn't have an object associated with it).

But since CoppeliaSim V4.2, you should instead use following, better way of doing things:

Code: Select all

objectHandle=sim.getObject('.')
Cheers