ChangeNBit() Method Parameter Issue: c4d.AHIDE_FOR_HOST Not Recognized?
-
I've identified an apparent invalid parameter error with GeListNode.ChangeNBit() in C4D 2024. Specifically, c4d.AHIDE_FOR_HOST throws an AttributeError, conflicting with its presence in the R20+ SDK documentation. Any insights on why this parameter isn't recognized?
import c4d doc.StartUndo() doc.AddUndo(c4d.UNDOTYPE_CHANGE, op) op.ChangeNBit(c4d.AHIDE_FOR_HOST, c4d.NBITCONTROL_SET) # error doc.EndUndo() c4d.EventAdd()
error
Traceback (most recent call last): File "scriptmanager", line 6, in <module> AttributeError: module 'c4d' has no attribute 'AHIDE_FOR_HOST'
-
Hey @kangddan,
Thank you for reaching out to us. The module attribute is
NBIT_AHIDE_FOR_HOST
. The line there in the docs might have been written when we still exposed symbols manually (and were a little bit inconsistent - these days symbols are exposed automatically) or always has been incorrect. But our documentation is still managed manually, something I probably should change, but that will also cost time.When unsure, you can always search
{c4d}\resource\modules\python\libs\python311\c4d\__init__.py
, as this is where all thec4d
symbols are defined. Or you just search{c4d}\resource\modules\python\libs\python311\
and with that the whole API. Last but not least, symbols are always just that - symbols - and you can also just use the raw value directly lifted from the C++ API frameworks (when something has not correctly been exposed for some reason). That would have been95
in this case:I have updated the Python docs for this member of NBIT to be named as
c4d.NBIT_AHIDE_FOR_HOST
.Cheers,
Ferdinand -
@ferdinand Thansk!