How to add an product attribute to multiple attribute sets programmatically?
This question has been answerded for Magento 1, but how does it work with Magento 2?
Edit: I create all my custom attributes in an installation script. They are created when installing magento (I add my extentions to the Magento folder before installing it on a server). At this time I don't know about the attrubute sets. They are created later during an import. So I want to assign existing custom attributes when creating an attribute set.