Regular API function

simLoadModule / sim.loadModule

Description Lua only. Loads a CoppeliaSim plugin. This should usually be done in the main client application, just after simRunSimulator was called. Alternatively, you can also dynamically load/unload a plugin, but depending on the plugin function, this might not work/lead to a crash. In case the dynamically loaded plugin registers custom Lua functions, those functions cannot be used in scripts that were already initialized (except for the script that called sim.loadModule). Normally, all plugins of type simExtXXX.dll (or libsimExtXXX.so or libsimExtXXX.dylib) in the CoppeliaSim directory are loaded at application start. Plugins that are meant to be dynamically loaded should use a different name, or a different directory. See also sim.unloadModule.
C/C++
synopsis
simInt simLoadModule(const simChar* filenameAndPath,const simChar* pluginName)
C/C++
parameters
filenameAndPath: file name and path of the plugin
pluginName: name of the plugin. If the file name is simExtXXX.dll, then the name should be XXX
C/C++
return value
handle of the plugin if value is 0 or positive. otherwise:
-3: plugin could not be loaded
-2: plugin is missing entry points
-1: plugin could not initialize
Lua
synopsis
int pluginHandle=sim.loadModule(string filenameAndPath,string pluginName)
Lua
parameters
Similar to the C-function counterpart
Lua
return values
Similar to the C-function counterpart
Python
synopsis
int pluginHandle=sim.loadModule(string filenameAndPath,string pluginName)