Create material groups

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

On 15/06/2004 at 00:04, xxxxxxxx wrote:

User Information:
Cinema 4D Version:   8.200 
Platform:   Windows  ;   
Language(s) :     C++  ;

---------
Hi,
I have some problem, to read a material group with a specific ID.
I add the new group with following commands:

BaseContainer group;
group.SetLong( MATERIALGROUP_ID, 12345 );
group.SetString( MATERIALGROUP_NAME, "TEST" );
group.SetBool( MATERIALGROUP_SELECTED, TRUE);
GetActiveDocument()->MaterialGroup_Add( group );

Now, I´ve got a new material group. But if I read with the command
BaseContainer *bc = GetActiveDocument()->MaterialGroup_GetID( 12345 );
The return pointer is always NULL. But the group exist. I see it.
Has anyone an idea ...

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

On 18/06/2004 at 14:05, xxxxxxxx wrote:

Confirmed. The ID seems to be set to the index, rather than the value you suppy in Add().

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

On 18/06/2004 at 14:44, xxxxxxxx wrote:

This is by design. C4D assigns the ID. You can check which ID was assigned in the container returned by _Add().