Hi Alex, As you found, there was a bug in Downcast. I've fixed it and made a zip of a new release at http://www.redbrick.dcu.ie/~noel/tmp/Release.zip
Can you test this, and let me know if it works for you. If so, I'll make a new OBDotNet release. - Noel On 29 January 2010 08:25, Demiurg HG <[email protected]> wrote: > Hello, > > I`m trying to retrive charge density (OBGridData) from Gaussuan Cube using > OBDotNet (latest version). > > My code looks like this: > > elem_table = new OBElementTable(); > conv = new OBConversion(); > mol = new OBMol(); > > if (!conv.SetInFormat("CUBE")) { throw new Exception("cann`t set input > format");} > if (!conv.ReadFile(mol, "test3.cube")) { throw new Exception("cann`t open > \"test3.cube\" file"); } > > mol.FindRingAtomsAndBonds(); > mol.Center(); > > VectorpData data_set = mol.GetAllData(openbabelcsharp.GridData); > > for (int i=0; i<data_set.Count; i++) { > OBGenericData data = data_set[i]; > OBGridData grid = data.Downcast<OBGridData>(); // <-- exception > } > > An unhandled exception of type 'System.InvalidCastException' occurred in > OBDotNet.dll > Additional information: No explicit downcast is defined for GridData. > > Thanks before hand. > Alex. > > ------------------------------------------------------------------------------ > The Planet: dedicated and managed hosting, cloud storage, colocation > Stay online with enterprise data centers and the best network in the > business > Choose flexible plans and management services without long-term contracts > Personal 24x7 support from experience hosting pros just a phone call away. > http://p.sf.net/sfu/theplanet-com > _______________________________________________ > OpenBabel-scripting mailing list > [email protected] > https://lists.sourceforge.net/lists/listinfo/openbabel-scripting > > ------------------------------------------------------------------------------ The Planet: dedicated and managed hosting, cloud storage, colocation Stay online with enterprise data centers and the best network in the business Choose flexible plans and management services without long-term contracts Personal 24x7 support from experience hosting pros just a phone call away. http://p.sf.net/sfu/theplanet-com _______________________________________________ OpenBabel-scripting mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/openbabel-scripting
