void MyWritePDBMolecule(oemolostream &ofs, OEMolBase &mol) { unsigned int flags; if (OEHasResidues(mol)) { OEPDBOrderAtoms(mol); } else OEPerceiveResidues(mol); if (mol.GetDimension() < 3) { // If no co-ordinates, write out bonds and bond orders. flags = OEPDBOFlag::ORDERS | OEPDBOFlag::BONDS; } else flags = OEPDBOFlag::DEFAULT; OEWritePDBFile(ofs, mol, flags); }