LUA to Python

Typically: "How do I... ", "How can I... " questions
Post Reply
fkaraal
Posts: 5
Joined: 24 Jul 2022, 00:38

LUA to Python

Post by fkaraal »

Hello,

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

what is the equivalent of this line in python?

coppelia
Site Admin
Posts: 10339
Joined: 14 Dec 2012, 00:25

Re: LUA to Python

Post 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

Post Reply