Regular API function

simGetObjectHandle / sim.getObjectHandle

Description Retrieves an object handle based on its name. The operation of this function depends on the current name suffix settings (see sim.getNameSuffix, sim.setNameSuffix, and the section on accessing general-type objects). See also 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 number objectHandle=sim.getObjectHandle(string objectName)
Lua parameters
Same as C-function
Lua return values
Same as C-function
Remote API equiv.
B0-based remote API: simxGetObjectHandle
Legacy remote API: simxGetObjectHandle

All regular API functions on one page