Name
CopyObjectData -- copy private data between objects (V5.0)
Synopsis
CopyObjectData(srctype, srcid, dsttype, dstid[, overwrite])
Function
This function copies all private data associated with the object specified by srctype and srcid to the object specified by dsttype and dstid. The optional overwrite argument specifies whether or not CopyObjectData() should overwrite keys in the destination object in case they share the name of keys in the source object. By default, this is set to True which means that existing keys in the destination object will be replaced with the keys in the source object in case their names are the same. If you do not want this behaviour, set overwrite to False.

See Object types for a list of all object types.

Inputs
srctype
type of source object to use
srcid
identifier of source object to use
dsttype
type of destination object to use
dstid
identifier of destination object to use
overwrite
optional: specifies whether or not existing keys in the destination object should be overwritten (defaults to True)
Example
SetObjectData(#BRUSH, 1, "name", "mybrush")
CopyObjectData(#BRUSH, 1, #BRUSH, 2)
DebugPrint(GetObjectData(#BRUSH, 2, "name"))
The code above copies all data keys of brush 1 to brush 2. The call to DebugPrint() will print "mybrush" then.

Show TOC