Regular API function

simGetObjectHandle / sim.getObjectHandle

Description Retrieves an object handle based on its name. See also the section on accessing general-type objects, sim.isHandleValid and sim.getObjectUniqueIdentifier.
C synopsis simInt simGetObjectHandle(const simChar* objectName)
C parameters
objectName: name of object. If the name is appended by a "@alt" suffix, then the object handle based on the object's alternative name will be retrieved. If the name is appended by a "@silentError" suffix, then no error will be output if the object does not exist.
C return value
handle of object or -1 if operation was not successful
Lua synopsis int objectHandle=sim.getObjectHandle(string/int objectName)
Lua parameters
Similar to the C-function counterpart. The objectName argument can additionally also be sim.handle_self, in order to retrieve the handle of the object associated with the script currently executing.
Lua return values
Similar to the C-function counterpart
Remote API equiv.
B0-based remote API: simxGetObjectHandle
Legacy remote API: simxGetObjectHandle