OESystem::OEIterBase<const std::string>* OEMoleculeToCores(const OEChem::OEMolBase &mol,
                                                           const OEMCSFragDatabaseOptions &opts,
                                                           bool permuteFragments=true);

Given a molecule, return the fragmentation cores using the provided fragmentation options. If the permuteFragments argument is true, all combinations of the generated fragmentation cores are generated, otherwise a unique set of multi-fragment cores is returned representing all combinations of bond fragmentations between the min and max cut limits.

Shown below is a version that uses the free function and custom options setup from command line arguments:

            // set the MCS fragment database options from the command-line arguments
            OEMCSFragDatabaseOptions fragopts = new OEMCSFragDatabaseOptions();
            if (!OEMedChem.OEConfigureMCSFragDatabaseOptions(itf))
                OEChem.OEThrow.Fatal("Error configuring options");
            if (!OEMedChem.OESetupMCSFragDatabaseOptions(fragopts, itf)) {
                OEChem.OEThrow.Fatal("Error setting options");

            // use the custom options to fragment an arbitrary input molecule
            Console.WriteLine("MoleculeToCores using command-line options:");
            List<string> cores = new List<string>();
            foreach (String c in OEMedChem.OEMoleculeToCores(mol, fragopts))
            int corenum = 0;
            foreach (String core in cores)
                Console.WriteLine(corenum + ": " + core);