Copy link to clipboard
Copied
I’ve got a group selected and was able to move that group with `translate` easily. I now need to duplicate that group and move the duplicate to another location. `group.duplicate(doc, ElementPlacement.PLACEATEND);` gives me the error “Error: Target layer cannot be modified”.
Suggestions?
Hello, brandond15025946.
Is the layer on which the group is duplicated locked or hide?
Keep the layer editable. (unlock and show)
How about this?
group.duplicate(group.parent, ElementPlacement.PLACEATEND);
Copy link to clipboard
Copied
Hello, brandond15025946.
Is the layer on which the group is duplicated locked or hide?
Keep the layer editable. (unlock and show)
How about this?
group.duplicate(group.parent, ElementPlacement.PLACEATEND);
Copy link to clipboard
Copied
Shoot… it’s the parent bit I missed. I was targeting the wrong container. Thanks!
Copy link to clipboard
Copied
Bonjour;
layer.locked = false;
layer.visible = true;
group.duplicate(layer, ElementPlacement.PLACEATEND);
Find more inspiration, events, and resources on the new Adobe Community
Explore Now