Is there any way to get the string value of the selected option from a cycle parameter? I tried to use shader's description (as I am testing on a shader) but it does not give the right result.
I came up with this solution which is working fine. Thanks for your help.
getDropDownName(Description* const description,
const DescID* singleid = description->GetSingleDescID();
const DescID cid = DescLevel(group_id, DTYPE_LONG, 0);
std::string selected_name = "";
if (!singleid || cid.IsPartOf(*singleid, nullptr))
BaseContainer* selectionParameter =
description->GetParameterI(DescLevel(group_id, DTYPE_LONG, 0), arr);
if (selectionParameter != nullptr)
BaseContainer* items =
if (items != nullptr)
thank you for reaching out to us.
About your question: Yes, that is possible. It would have been better if you have shared what you tried, so that we would have a better idea what there did not give you the right result, but in principle you must get the cycle container for that description element in question and then read out its values. See Python example at the end of my posting for details. The example translates almost directly to C++, the only thing that is a little bit different in C++ is the fact that we do not have such a convenient auto-iteration for BaseContainer there.
"""Example for how to read out the labels for a cycle description element.
The example is a Python Script Manger script which will read out the strings
of all cycle elements of the currently selected Extrude Object and its
As discussed in:
if not isinstance(op, c4d.BaseObject) or op.GetType() != c4d.Oextrude:
raise RuntimeError("Please select an Extrude Object.")
description = op.GetDescription(c4d.DESCFLAGS_DESC_NONE)
directionContainer = description.GetParameter(c4d.EXTRUDEOBJECT_DIRECTION)
print (f"Localized direction label:", directionContainer[c4d.DESC_NAME])
cycleContainer = directionContainer[c4d.DESC_CYCLE]
if not cycleContainer:
raise RuntimeError("Could not access cycle container.")
for key, value in cycleContainer:
print (key, value)
Localized direction label: Direction