From: Noel O'B. <bao...@gm...> - 2008-11-13 07:51:34
|
---------- Forwarded message ---------- From: Bordeau, Brian <Bri...@am...> Date: 2008/11/13 Subject: OBdotnet To: bao...@gm... Hi Noel, I am relatively new to using open source libraries, message boards and the like so I don't know if/how people post messages or questions. I am a relatively proficient VB.net programmer and would like to use the OBdotnet.dll library but am not sure if it has been designed for this purpose – is this library solely for IronPython or could it be used in a .net program. I'd be happy to post this to an appropriate board but don't exactly know where. Thanks Brian Brian Bordeau Research Scientist III, In Vitro Biology AMRI Bothell Research Center 18804 North Creek Parkway Bothell, WA 98011 email:bri...@am... Phone:1-425-424-7293 Fax: 1-425-424-7299 |
From: Noel O'B. <bao...@gm...> - 2008-11-13 07:57:18
|
2008/11/13 Bordeau, Brian <Bri...@am...>: > Hi Noel, > > I am relatively new to using open source libraries, message > boards and the like so I don't know if/how people post messages or > questions. Generally, we cc everything to ope...@li... so that we have a record. I've forwarded your original message. Welcome to open source. :-) > I am a relatively proficient VB.net programmer and would like to > use the OBdotnet.dll library but am not sure if it has been designed for > this purpose – is this library solely for IronPython or could it be used in > a .net program. It's actually designed for .NET. I'm just more interested in IronPython than the other .NET languages. The main OBdotnet developer is interested in C# (Matt Sprague). We welcome feedback on this code, so let us know how it goes. Regards, Noel |
From: Matt S. <mes...@gm...> - 2008-11-13 09:00:22
|
Hi Brian, In regards to your question about OBDotNet it is useable from any language that compiles for the CLR. This includes C#, VB, F#, S# (small talk.net) etc. Because all of these languages compile to a common byte code and use the FCL (framework class library) the assemblies are mostly interchangeable and the choice of language is really just a matter of personal preference. VB.Net is a core MS language so OBDotNet should work just fine. Worst case, if something wasn't supported it just won't be exposed when you reference an assembly but it won't prevent the rest of the library from functioning. If you have any further questions or need any help just post to the mailing list. Noel knows more about OpenBabel and I handle the more specific CLR/FCL related stuff. -Matt Sprague On Thu, Nov 13, 2008 at 12:57 AM, Noel O'Boyle <bao...@gm...> wrote: > 2008/11/13 Bordeau, Brian <Bri...@am...>: > > Hi Noel, > > > > I am relatively new to using open source libraries, message > > boards and the like so I don't know if/how people post messages or > > questions. > Generally, we cc everything to ope...@li... so > that we have a record. I've forwarded your original message. Welcome > to open source. :-) > > > I am a relatively proficient VB.net programmer and would like to > > use the OBdotnet.dll library but am not sure if it has been designed for > > this purpose – is this library solely for IronPython or could it be used > in > > a .net program. > It's actually designed for .NET. I'm just more interested in > IronPython than the other .NET languages. The main OBdotnet developer > is interested in C# (Matt Sprague). > > We welcome feedback on this code, so let us know how it goes. > > Regards, > Noel > > ------------------------------------------------------------------------- > This SF.Net email is sponsored by the Moblin Your Move Developer's > challenge > Build the coolest Linux based applications with Moblin SDK & win great > prizes > Grand prize is a trip for two to an Open Source event anywhere in the world > http://moblin-contest.org/redirect.php?banner_id=100&url=/ > _______________________________________________ > OpenBabel-scripting mailing list > Ope...@li... > https://lists.sourceforge.net/lists/listinfo/openbabel-scripting > |
From: Brian B. <bri...@am...> - 2008-11-13 18:33:52
|
Hi Matt, I've referenced the OBdotnet.dll in my project and based on the errors am wondering if I missed referencing a library or set up the OBConv incorrectly. Could you check the following app (in VB.net 2008) and see if there is anything obvious: Imports OpenBabel Public Class Form1 Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click Dim strFolder As String = "c:\Structures\" Dim OBConv As New OBConversion() Dim OBBase As New OBBase() OBConv.SetInAndOutFormats("sdf", "smi") OBConv.ReadFile(OBBase, strFolder & "*.sdf") OBConv.WriteFile(OBBase, strFolder & "*.smi") End Sub End Class I'm getting the error(s) : System.TypeInitializationException was unhandled Message="The type initializer for 'OpenBabel.openbabelPINVOKE' threw an exception." Source="OBDotNet" TypeName="OpenBabel.openbabelPINVOKE" and inner exceptions: InnerException: System.TypeInitializationException Message="The type initializer for 'SWIGExceptionHelper' threw an exception." Source="OBDotNet" TypeName="SWIGExceptionHelper" and InnerException: System.DllNotFoundException Message="Unable to load DLL 'openbabel': The specified module could not be found. (Exception from HRESULT: 0x8007007E)" Source="OBDotNet" TypeName="" StackTrace: at OpenBabel.openbabelPINVOKE.SWIGExceptionHelper.SWIGRegisterExceptionCallbacks_openbabel(ExceptionDelegate applicationDelegate, ExceptionDelegate arithmeticDelegate, ExceptionDelegate divideByZeroDelegate, ExceptionDelegate indexOutOfRangeDelegate, ExceptionDelegate invalidCastDelegate, ExceptionDelegate invalidOperationDelegate, ExceptionDelegate ioDelegate, ExceptionDelegate nullReferenceDelegate, ExceptionDelegate outOfMemoryDelegate, ExceptionDelegate overflowDelegate, ExceptionDelegate systemExceptionDelegate) at OpenBabel.openbabelPINVOKE.SWIGExceptionHelper..cctor() InnerException: Thanks Brian Matt Sprague wrote: > > Hi Brian, > > In regards to your question about OBDotNet it is useable from any language > that compiles for the CLR. This includes C#, VB, F#, S# (small talk.net) > etc. Because all of these languages compile to a common byte code and use > the FCL (framework class library) the assemblies are mostly > interchangeable > and the choice of language is really just a matter of personal preference. > VB.Net is a core MS language so OBDotNet should work just fine. Worst > case, > if something wasn't supported it just won't be exposed when you reference > an > assembly but it won't prevent the rest of the library from functioning. > > If you have any further questions or need any help just post to the > mailing > list. Noel knows more about OpenBabel and I handle the more specific > CLR/FCL related stuff. > > -Matt Sprague > > > On Thu, Nov 13, 2008 at 12:57 AM, Noel O'Boyle <bao...@gm...> > wrote: > >> 2008/11/13 Bordeau, Brian <Bri...@am...>: >> > Hi Noel, >> > >> > I am relatively new to using open source libraries, message >> > boards and the like so I don't know if/how people post messages or >> > questions. >> Generally, we cc everything to ope...@li... so >> that we have a record. I've forwarded your original message. Welcome >> to open source. :-) >> >> > I am a relatively proficient VB.net programmer and would like to >> > use the OBdotnet.dll library but am not sure if it has been designed >> for >> > this purpose – is this library solely for IronPython or could it be >> used >> in >> > a .net program. >> It's actually designed for .NET. I'm just more interested in >> IronPython than the other .NET languages. The main OBdotnet developer >> is interested in C# (Matt Sprague). >> >> We welcome feedback on this code, so let us know how it goes. >> >> Regards, >> Noel >> >> ------------------------------------------------------------------------- >> This SF.Net email is sponsored by the Moblin Your Move Developer's >> challenge >> Build the coolest Linux based applications with Moblin SDK & win great >> prizes >> Grand prize is a trip for two to an Open Source event anywhere in the >> world >> http://moblin-contest.org/redirect.php?banner_id=100&url=/ >> _______________________________________________ >> OpenBabel-scripting mailing list >> Ope...@li... >> https://lists.sourceforge.net/lists/listinfo/openbabel-scripting >> > > ------------------------------------------------------------------------- > This SF.Net email is sponsored by the Moblin Your Move Developer's > challenge > Build the coolest Linux based applications with Moblin SDK & win great > prizes > Grand prize is a trip for two to an Open Source event anywhere in the > world > http://moblin-contest.org/redirect.php?banner_id=100&url=/ > _______________________________________________ > OpenBabel-scripting mailing list > Ope...@li... > https://lists.sourceforge.net/lists/listinfo/openbabel-scripting > > -- View this message in context: http://www.nabble.com/Re%3A-OBdotnet-tp20476218p20486773.html Sent from the openbabel-scripting mailing list archive at Nabble.com. |
From: Brian B. <bri...@am...> - 2008-11-13 21:38:12
|
Hi Matt, It works! The key was dropping the whole folder contents into the debug folder as you said. Here is the working code in case there is some other VB soul out there: Imports OpenBabel Public Class Form1 Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click Dim strFolder As String = "c:\Structures\" Dim OBConv As New OBConversion() Dim OBMol As New OBMol() OBConv.SetInAndOutFormats("sdf", "smi") OBConv.ReadFile(OBMol, strFolder & "Structure1.sdf") OBConv.WriteFile(OBMol, strFolder & "Structure1.smi") End Sub End Class Just replace the Structure1.sdf with your own sdf file. Enjoy! Brian Brian Bordeau wrote: > > Hi Matt, > I've referenced the OBdotnet.dll in my project and based on the errors > am wondering if I missed referencing a library or set up the OBConv > incorrectly. Could you check the following app (in VB.net 2008) and see if > there is anything obvious: > > Imports OpenBabel > > Public Class Form1 > Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As > System.EventArgs) Handles Button1.Click > Dim strFolder As String = "c:\Structures\" > Dim OBConv As New OBConversion() > Dim OBBase As New OBBase() > > OBConv.SetInAndOutFormats("sdf", "smi") > > OBConv.ReadFile(OBBase, strFolder & "*.sdf") > OBConv.WriteFile(OBBase, strFolder & "*.smi") > > End Sub > End Class > > I'm getting the error(s) : > > System.TypeInitializationException was unhandled > Message="The type initializer for 'OpenBabel.openbabelPINVOKE' threw an > exception." > Source="OBDotNet" > TypeName="OpenBabel.openbabelPINVOKE" > > and inner exceptions: > > InnerException: System.TypeInitializationException > Message="The type initializer for 'SWIGExceptionHelper' threw an > exception." > Source="OBDotNet" > TypeName="SWIGExceptionHelper" > > and > > InnerException: System.DllNotFoundException > Message="Unable to load DLL 'openbabel': The specified module > could not be found. (Exception from HRESULT: 0x8007007E)" > Source="OBDotNet" > TypeName="" > StackTrace: > at > OpenBabel.openbabelPINVOKE.SWIGExceptionHelper.SWIGRegisterExceptionCallbacks_openbabel(ExceptionDelegate > applicationDelegate, ExceptionDelegate arithmeticDelegate, > ExceptionDelegate divideByZeroDelegate, ExceptionDelegate > indexOutOfRangeDelegate, ExceptionDelegate invalidCastDelegate, > ExceptionDelegate invalidOperationDelegate, ExceptionDelegate ioDelegate, > ExceptionDelegate nullReferenceDelegate, ExceptionDelegate > outOfMemoryDelegate, ExceptionDelegate overflowDelegate, ExceptionDelegate > systemExceptionDelegate) at > OpenBabel.openbabelPINVOKE.SWIGExceptionHelper..cctor() > InnerException: > > Thanks > > Brian > > > > > > > > Matt Sprague wrote: >> >> Hi Brian, >> >> In regards to your question about OBDotNet it is useable from any >> language >> that compiles for the CLR. This includes C#, VB, F#, S# (small talk.net) >> etc. Because all of these languages compile to a common byte code and use >> the FCL (framework class library) the assemblies are mostly >> interchangeable >> and the choice of language is really just a matter of personal >> preference. >> VB.Net is a core MS language so OBDotNet should work just fine. Worst >> case, >> if something wasn't supported it just won't be exposed when you reference >> an >> assembly but it won't prevent the rest of the library from functioning. >> >> If you have any further questions or need any help just post to the >> mailing >> list. Noel knows more about OpenBabel and I handle the more specific >> CLR/FCL related stuff. >> >> -Matt Sprague >> >> >> On Thu, Nov 13, 2008 at 12:57 AM, Noel O'Boyle <bao...@gm...> >> wrote: >> >>> 2008/11/13 Bordeau, Brian <Bri...@am...>: >>> > Hi Noel, >>> > >>> > I am relatively new to using open source libraries, >>> message >>> > boards and the like so I don't know if/how people post messages or >>> > questions. >>> Generally, we cc everything to ope...@li... so >>> that we have a record. I've forwarded your original message. Welcome >>> to open source. :-) >>> >>> > I am a relatively proficient VB.net programmer and would like to >>> > use the OBdotnet.dll library but am not sure if it has been designed >>> for >>> > this purpose – is this library solely for IronPython or could it be >>> used >>> in >>> > a .net program. >>> It's actually designed for .NET. I'm just more interested in >>> IronPython than the other .NET languages. The main OBdotnet developer >>> is interested in C# (Matt Sprague). >>> >>> We welcome feedback on this code, so let us know how it goes. >>> >>> Regards, >>> Noel >>> >>> ------------------------------------------------------------------------- >>> This SF.Net email is sponsored by the Moblin Your Move Developer's >>> challenge >>> Build the coolest Linux based applications with Moblin SDK & win great >>> prizes >>> Grand prize is a trip for two to an Open Source event anywhere in the >>> world >>> http://moblin-contest.org/redirect.php?banner_id=100&url=/ >>> _______________________________________________ >>> OpenBabel-scripting mailing list >>> Ope...@li... >>> https://lists.sourceforge.net/lists/listinfo/openbabel-scripting >>> >> >> ------------------------------------------------------------------------- >> This SF.Net email is sponsored by the Moblin Your Move Developer's >> challenge >> Build the coolest Linux based applications with Moblin SDK & win great >> prizes >> Grand prize is a trip for two to an Open Source event anywhere in the >> world >> http://moblin-contest.org/redirect.php?banner_id=100&url=/ >> _______________________________________________ >> OpenBabel-scripting mailing list >> Ope...@li... >> https://lists.sourceforge.net/lists/listinfo/openbabel-scripting >> >> > > -- View this message in context: http://www.nabble.com/Re%3A-OBdotnet-tp20476218p20490071.html Sent from the openbabel-scripting mailing list archive at Nabble.com. |
From: Matt S. <mes...@gm...> - 2008-11-13 18:44:57
|
Because OBDotNet was built with SWIG it uses an intermediate managed C++ dll to access OpenBabel. Thats what openbabel.dll is. The program needs to be able to see the full contents of the OBDotNet distribution. Follow the directions in the IronPython instructions with regards to setting environment variables. Remember that VS (I assume thats what your using) by default will copy a referenced assembly to the release/debug directories but won't know to bring any dependencies with it. I'm working on creating an installer for the package but it won't be ready for a while yet. -Matt On Thu, Nov 13, 2008 at 11:33 AM, Brian Bordeau < bri...@am...> wrote: > > Hi Matt, > I've referenced the OBdotnet.dll in my project and based on the errors > am wondering if I missed referencing a library or set up the OBConv > incorrectly. Could you check the following app (in VB.net 2008) and see if > there is anything obvious: > > Imports OpenBabel > > Public Class Form1 > Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As > System.EventArgs) Handles Button1.Click > Dim strFolder As String = "c:\Structures\" > Dim OBConv As New OBConversion() > Dim OBBase As New OBBase() > > OBConv.SetInAndOutFormats("sdf", "smi") > > OBConv.ReadFile(OBBase, strFolder & "*.sdf") > OBConv.WriteFile(OBBase, strFolder & "*.smi") > > End Sub > End Class > > I'm getting the error(s) : > > System.TypeInitializationException was unhandled > Message="The type initializer for 'OpenBabel.openbabelPINVOKE' threw an > exception." > Source="OBDotNet" > TypeName="OpenBabel.openbabelPINVOKE" > > and inner exceptions: > > InnerException: System.TypeInitializationException > Message="The type initializer for 'SWIGExceptionHelper' threw an > exception." > Source="OBDotNet" > TypeName="SWIGExceptionHelper" > > and > > InnerException: System.DllNotFoundException > Message="Unable to load DLL 'openbabel': The specified module > could not be found. (Exception from HRESULT: 0x8007007E)" > Source="OBDotNet" > TypeName="" > StackTrace: > at > > OpenBabel.openbabelPINVOKE.SWIGExceptionHelper.SWIGRegisterExceptionCallbacks_openbabel(ExceptionDelegate > applicationDelegate, ExceptionDelegate arithmeticDelegate, > ExceptionDelegate > divideByZeroDelegate, ExceptionDelegate indexOutOfRangeDelegate, > ExceptionDelegate invalidCastDelegate, ExceptionDelegate > invalidOperationDelegate, ExceptionDelegate ioDelegate, ExceptionDelegate > nullReferenceDelegate, ExceptionDelegate outOfMemoryDelegate, > ExceptionDelegate overflowDelegate, ExceptionDelegate > systemExceptionDelegate) at > OpenBabel.openbabelPINVOKE.SWIGExceptionHelper..cctor() > InnerException: > > Thanks > > Brian > > > > > > > > Matt Sprague wrote: > > > > Hi Brian, > > > > In regards to your question about OBDotNet it is useable from any > language > > that compiles for the CLR. This includes C#, VB, F#, S# (small talk.net) > > etc. Because all of these languages compile to a common byte code and use > > the FCL (framework class library) the assemblies are mostly > > interchangeable > > and the choice of language is really just a matter of personal > preference. > > VB.Net is a core MS language so OBDotNet should work just fine. Worst > > case, > > if something wasn't supported it just won't be exposed when you reference > > an > > assembly but it won't prevent the rest of the library from functioning. > > > > If you have any further questions or need any help just post to the > > mailing > > list. Noel knows more about OpenBabel and I handle the more specific > > CLR/FCL related stuff. > > > > -Matt Sprague > > > > > > On Thu, Nov 13, 2008 at 12:57 AM, Noel O'Boyle <bao...@gm...> > > wrote: > > > >> 2008/11/13 Bordeau, Brian <Bri...@am...>: > >> > Hi Noel, > >> > > >> > I am relatively new to using open source libraries, > message > >> > boards and the like so I don't know if/how people post messages or > >> > questions. > >> Generally, we cc everything to ope...@li... so > >> that we have a record. I've forwarded your original message. Welcome > >> to open source. :-) > >> > >> > I am a relatively proficient VB.net programmer and would like to > >> > use the OBdotnet.dll library but am not sure if it has been designed > >> for > >> > this purpose – is this library solely for IronPython or could it be > >> used > >> in > >> > a .net program. > >> It's actually designed for .NET. I'm just more interested in > >> IronPython than the other .NET languages. The main OBdotnet developer > >> is interested in C# (Matt Sprague). > >> > >> We welcome feedback on this code, so let us know how it goes. > >> > >> Regards, > >> Noel > >> > >> > ------------------------------------------------------------------------- > >> This SF.Net email is sponsored by the Moblin Your Move Developer's > >> challenge > >> Build the coolest Linux based applications with Moblin SDK & win great > >> prizes > >> Grand prize is a trip for two to an Open Source event anywhere in the > >> world > >> http://moblin-contest.org/redirect.php?banner_id=100&url=/ > >> _______________________________________________ > >> OpenBabel-scripting mailing list > >> Ope...@li... > >> https://lists.sourceforge.net/lists/listinfo/openbabel-scripting > >> > > > > ------------------------------------------------------------------------- > > This SF.Net email is sponsored by the Moblin Your Move Developer's > > challenge > > Build the coolest Linux based applications with Moblin SDK & win great > > prizes > > Grand prize is a trip for two to an Open Source event anywhere in the > > world > > http://moblin-contest.org/redirect.php?banner_id=100&url=/ > > _______________________________________________ > > OpenBabel-scripting mailing list > > Ope...@li... > > https://lists.sourceforge.net/lists/listinfo/openbabel-scripting > > > > > > -- > View this message in context: > http://www.nabble.com/Re%3A-OBdotnet-tp20476218p20486773.html > Sent from the openbabel-scripting mailing list archive at Nabble.com. > > > ------------------------------------------------------------------------- > This SF.Net email is sponsored by the Moblin Your Move Developer's > challenge > Build the coolest Linux based applications with Moblin SDK & win great > prizes > Grand prize is a trip for two to an Open Source event anywhere in the world > http://moblin-contest.org/redirect.php?banner_id=100&url=/ > _______________________________________________ > OpenBabel-scripting mailing list > Ope...@li... > https://lists.sourceforge.net/lists/listinfo/openbabel-scripting > |
From: Matt S. <mes...@gm...> - 2008-11-13 18:52:56
|
As an addendum: After the first problem is corrected... This code will probably fail Dim OBBase As New OBBase() OBConv.SetInAndOutFormats("sdf", "smi") > > OBConv.ReadFile(OBBase, strFolder & "*.sdf") > OBConv.WriteFile(OBBase, strFolder & "*.smi") Pass the method an OBMol not an OBBase. OBMol extends OBBase but if you declare the object as an OBBase the code will probably fail because OpenBabel won't be able to cast it down to an OBMol when it goes to process the file. -Matt |