Skip to main content
Participant
December 21, 2017
Answered

How can I duplicate and move a selected group?

  • December 21, 2017
  • 2 replies
  • 1101 views

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?

This topic has been closed for replies.
Correct answer OMOTI

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);

2 replies

renél80416020
Inspiring
December 22, 2017

Bonjour;

layer.locked = false;

layer.visible = true;

group.duplicate(layer, ElementPlacement.PLACEATEND);

OMOTI
OMOTICorrect answer
Inspiring
December 22, 2017

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);

Participant
December 22, 2017

Shoot… it’s the parent bit I missed. I was targeting the wrong container. Thanks!