app.project.item(index).layer(index).duplicate()
Description
Duplicates the layer. Creates a new Layer object in which all values are the same as in this one. This has the same effect as selecting a layer in the user interface and choosing Edit > Duplicate, except the selection in the user interface does not change when you call this method.
Parameters
None.
Returns
Layer object.