Simple Python script - Adding a primitive object to the active layer I use great "Pie Menu Editor" addon and in the "command" section I would like to add command that adds a primitive object to the scene, but only to the active layer.

Default code that can be copied from the "Info" window allows to specify to which layers a new object can be assigned, but does not allow to specify the currently active one.

Thank you for Your advice
right click on the add cube icon and then click Pie Menu Editor.



then it will ask you in which menu you want to put it.



by default the the arguments for layers are all False


so unless you specify one it will always create the cube in the activate layer