Parameter Access

The parameters can be accessed with the following 4 methods:

The methods are defined in the PrivateChunk class which is the parent class for all elements (objects, materials, tags etc.).
The functions return true if the parameter was retrieved/assigned, otherwise false.
id is the ID of the parameter to get/set, usually defined in c4d_parameter_ids.h or in a header of parameter_ids folder.
data retrives/assigns the value of the parameter (e.g. String, Int32, Float32 etc.).

For example the parameter IDs for the layer object are defined in parameter_ids/olayer.h header:

To access the ID_LAYER_COLOR parameter:

GeData data;
Vector col;
if (pLayer->GetParameter(ID_LAYER_COLOR, data))
{
LONG type = data.GetType();
if (type==DA_VECTOR)
col = data.GetVector();
}
Note
The ID for a parameter can be obtained directly in Cinema 4D by dragging it into the Console or Script Manager.
ID_LAYER_MANAGER
@ ID_LAYER_MANAGER
Definition: olayer.h:9
ID_LAYER_EXPRESSIONS
@ ID_LAYER_EXPRESSIONS
Definition: olayer.h:13
ID_LAYER_COLOR
@ ID_LAYER_COLOR
Definition: olayer.h:15
ID_LAYER_LOCKED
@ ID_LAYER_LOCKED
Definition: olayer.h:10
cineware::Vector
Vector64 Vector
Definition: ge_math.h:163
ID_LAYER_RENDER
@ ID_LAYER_RENDER
Definition: olayer.h:8
ID_LAYER_ANIMATION
@ ID_LAYER_ANIMATION
Definition: olayer.h:14
ID_LAYER_DEFORMERS
@ ID_LAYER_DEFORMERS
Definition: olayer.h:12
ID_LAYER_GENERATORS
@ ID_LAYER_GENERATORS
Definition: olayer.h:11
ID_LAYER_XREF
@ ID_LAYER_XREF
Definition: olayer.h:16
cineware::DA_VECTOR
@ DA_VECTOR
Vector.
Definition: c4d_gedata.h:35
ID_LAYER_SOLO
@ ID_LAYER_SOLO
Definition: olayer.h:6
ID_LAYER_VIEW
@ ID_LAYER_VIEW
Definition: olayer.h:7