title: Magento 2 - How to create an attribute set based on default
body: <p>I currently have the following code which creates a new attribute set:</p>
  
  <pre><code>use Magento\Framework\ObjectManagerInterface;
  use Magento\Eav\Setup\EavSetupFactory;
  use Magento\Framework\Setup\ModuleDataSetupInterface;
  
  class AttributeModel extends \Magento\Framework\Model\AbstractModel
  {
  
      const ENTITY_TYPE = \Magento\Catalog\Model\Product::ENTITY;
  
      protected $_objectManager;
      protected $_moduleDataSetup;
      protected $_eavSetupFactory;
  
      public function __construct(
          ObjectManagerInterface $objectManager,
          ModuleDataSetupInterface $moduleDataSetup,
          EavSetupFactory $eavSetupFactory,
      ) {
  
          $this-&gt;_objectManager = $objectManager;
          $this-&gt;_moduleDataSetup = $moduleDataSetup;
          $this-&gt;_eavSetupFactory = $eavSetupFactory;
  
      }
  
      public function createSet($name)
      {
  
          $eavSetup = $this-&gt;_eavSetupFactory-&gt;create([
              'setup' =&gt; $this-&gt;_moduleDataSetup
          ]);
  
          $eavSetup-&gt;addAttributeSet(self::ENTITY_TYPE, $name, 0);
  
      }
  
  }
  </code></pre>
  
  <p>However the set has no attributes assigned to it. How would I create the set based on the default one, so it is pre populated with the basic attributes?</p>
  
  <p>Any help much appreciated.</p>