Regular API function

simAddObjectCustomData

Description Adds or removes custom data to be stored and saved together with an object. This function is useful for external applications or plugin which want to save their data together with an object. Use in conjunction with simGetObjectCustomData and simGetObjectCustomDataLength. See also simWriteCustomDataBlock and simAddSceneCustomData.
C synopsis simInt simAddObjectCustomData(simInt objectHandle,simInt header,const simChar* data,simInt dataLength)
C parameters
objectHandle: handle of the object where you want to store your data
header: identifier for the custom data. If you plan to add custom data (as a company or individual), always use the same header (because only you will know what data type is stored under that header) and stick to it. The best is to use the serial number of your V-REP copy (check the "Help" menu, in the "About" item for the serial number). Otherwise, you risk collision with other developer's data which might use the same header as yours.
data: your custom data. If NULL, the current data under that header will be removed. If you have several items or data types to save, it is your responsibility to pack and code it in data (don't use various headers for each of your items that you want to save with an object (risk of collision with other developers data (see above))!)
dataLength: the length of your custom data

The data will be copied to an internal buffer inside of the object, 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=simAddObjectCustomData(number objectHandle,number header,string data)
Lua parameters
Same as C-function. (remember that a string in Lua might contain any character, also embedded zeros)
Lua return values
Same as C-function.

All regular API functions on one page