Skip to main content
Grey_Rift
Participant
January 25, 2017
Answered

How to place Layersets into Layersets.

  • January 25, 2017
  • 1 reply
  • 1020 views

I have checked the forum and I found how to place a layer into a layerset but when I try to apply the same method for placing a layerset into a layerset I get this error.

Illegal Argument. .....

This is the code that I am using:

//Making off LayerGroups
var OccGroupLay = app.activeDocument.layerSets.add();

    var OccLivery_01Lay = app.activeDocument.layerSets.add(); 

    var OccLivery_02Lay = app.activeDocument.layerSets.add();

    var OccMkLay = app.activeDocument.layerSets.add();

    //renaming Layers

    OccGroupLay.name = ('OCC');

    OccLivery_01Lay.name = ('Livery_01');

    OccLivery_02Lay.name = ('Livery_02');

    OccMkLay.name = ('MK');   

//move the layers into the layerset 

   OccLivery_01Lay.move(OccGroupLay, ElementPlacement.INSIDE); 

OccLivery_02Lay.move(OccGroupLay, ElementPlacement.INSIDE);
This topic has been closed for replies.
Correct answer Chuck Uebele

There is a bug with that. To do a workaround, create a layer inside the group you want to move the other group to, then use PLACEBEFORE for that layer - not the group. Then you can delete that layer.

1 reply

Chuck Uebele
Community Expert
Chuck UebeleCommunity ExpertCorrect answer
Community Expert
January 25, 2017

There is a bug with that. To do a workaround, create a layer inside the group you want to move the other group to, then use PLACEBEFORE for that layer - not the group. Then you can delete that layer.