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

Reply via email to