Creating subcontainers

THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED

On 02/01/2009 at 12:05, xxxxxxxx wrote:

User Information:
Cinema 4D Version:   10.x 
Platform:      Mac OSX  ; 
Language(s) :   C.O.F.F.E.E  ;

---------
I want to create a subcontainer inside an object container.
It will have a unique ID (1000001 for now, for testing purposes) so that I can place inside it data with IDs of my choice (100,101,102,etc, for example).
So, I tried using this code:

> container=op->GetContainer(); \> ct2=container->GetContainer(1000001); \> if(!ct2) \>      { \>      ct2=new(BaseContainer); \>      ct2->SetId(1000001); \>      ct2->SetData(100,0); \>      ct2->SetData(101,0); \>      ct2->SetData(102,0); \>      }

But... how do I store the new container with ID=1000001 inside the object container?!?

> container->SetContainer(ct2);

doesn't seem to work 😞

Rui Batista

THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED

On 03/01/2009 at 04:28, xxxxxxxx wrote:

Use SetData().

cheers,
Matthias

THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED

On 03/01/2009 at 04:31, xxxxxxxx wrote:

But I'm using SetData, as you can see. How can I use SetData to create a subcontainer? Rui Batista

THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED

On 03/01/2009 at 04:49, xxxxxxxx wrote:

This should work.

> \> container->SetData(ct2); \>

cheers,
Matthias

THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED

On 04/01/2009 at 04:08, xxxxxxxx wrote:

Yes, it works!! Thank you very much, Matthias 🙂 Rui Batista