Regular API function

simWriteCustomDataBlock / sim.writeCustomDataBlock

Description Adds or removes custom data to be stored and saved together with an object, or the scene. If the tag name ends with the string "@tmp", then the data will not be saved during a scene or model save operation. The data can also be saved globally for the application (for the current CoppeliaSim session). See also the other custom data block related functions and the data packing/unpacking functions. If you wish to store a reference to another object, have a look at sim.setReferencedHandles.
C/C++
synopsis
simInt simWriteCustomDataBlock(simInt objectHandle,const simChar* tagName,const simChar* data,simInt dataSize)
C/C++
parameters
objectHandle: handle of the object where you want to store your data, or sim.handle_scene if you wish to store the data with the scene, or sim.handle_app if you wish to store the data with the application's current session.
tagName: a string that identifies the data. An empty string will remove all custom data blocks.
data: your custom data. If nullptr or empty, the current data under the specified dataName will be removed.
dataSize: the size of your custom data
C/C++
return value
-1 if operation was not successful
Lua
synopsis
sim.writeCustomDataBlock(int objectHandle,string tagName,buffer data)
Lua
parameters
Similar to the C-function counterpart.
Lua
return values
Python
synopsis
sim.writeCustomDataBlock(int objectHandle,string tagName,string/bytes data)