apend a layer to an Object

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

On 21/04/2009 at 23:30, xxxxxxxx wrote:

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

---------
Hi all,
I want to apend a Layer(out of a list of several Layers)  to all objects.
I looked at the SDK but I only found
SetLayerObject(_<_a title="class layerobject : public baselist2d" href= "mk:@msitstore:c:\maxon\cinema%204d%20r11%20development\plugins\c4dr11sdkchm20090324.chm::/pages/c4d_basedocument/class_layerobject752.html"_>_ LayerObject* layer)
Is this the correct on?

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

On 22/04/2009 at 01:51, xxxxxxxx wrote:

Yes SetLayerObject() is the correct method. Here a little example that assigns the first layer to all objects.

> \> void StepThruHierarchy(BaseObject \*obj, LayerObject \*layer) \> { \>      while (obj && layer) \>      { \>           obj->SetLayerObject(layer); \> \>           obj->Message(MSG_UPDATE); \> \>           StepThruHierarchy(obj->GetDown(), layer); \>           obj = obj->GetNext(); \>      } \> } \> \> Bool MenuTest::Execute(BaseDocument \*doc) \> { \>      StopAllThreads(); \> \>      GeListHead \*layerlist = NULL; \>      layerlist = doc->GetLayerObjectRoot(); \>      if (!layerlist) return FALSE; \> \>      StepThruHierarchy(doc->GetFirstObject(), (LayerObject\* )layerlist->GetFirst()); \> \>      EventAdd(); \>            \>      return TRUE; \> } \>

cheers,
Matthias