Regular API function

simWriteCustomDataBlock

Description Adds or removes custom data to be stored and saved together with an object, a script or a scene (i.e. the data will be part of the object, the script or the scene). If the tag name starts 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 V-REP session). See also simReadCustomDataBlock and the data packing/unpacking functions. If you wish to store a reference to another object, have a look at simSetReferencedHandles.
C synopsis simInt simWriteCustomDataBlock(simInt objectHandle,const simChar* tagName,const simChar* data,simInt dataSize)
C parameters
objectHandle: handle of the object or script 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 NULL, the current data under the specified dataName will be removed.
dataSize: the size of your custom data

The data will be copied to an internal buffer inside of the object or scene, and next time a scene or model is saved, will also be saved. The data buffer can be released after this call.
C return value
-1 if operation was not successful. In a future release, a more differentiated return value might be available
Lua synopsis number result=simWriteCustomDataBlock(number objectHandle,string tagName,string data)
Lua parameters
Same as C-function. In addition, you can specify sim_handle_self for the objectHandle argument, if your target is the current script.
Lua return values
Same as C-function.

All regular API functions on one page