THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED
On 05/10/2012 at 00:14, xxxxxxxx wrote:
Hi Rui.
Thanks for the answer, I kinda was expecting the basecontainer, but honestly I have no idea where to start. So I create a basecontainer like this:
bc = c4d.BaseContainer()
bc.SetString(1, "test")
bc.SetId(1234)
print bc.GetId()
print bc[1]
Easy enough and works without a problem, but how do I store this specific container in the document/file? The SDK says follwoing:
It is recommended that you use the available containers to store your own values as well. That way they will be automatically saved. However, if you want to store values in the top level of for example an object container, you'll have to use a unique id.
But I have absolutely no idea how to get an "available container" that will be automatically saved, or how to add to an objects container. Or is adding to an objects container as simple as the follwoing code (given you have an object selected) :
op[1234] = "test"
I stumbled yesterday upon this, but it seems way to easy to be the right way. Even if I store a new basecontainer within the document/file, how do I access it. Logical would be doc.GetBasecontainer(id) but there isn't a function like this.
Thanks in advance.
Phil