How to use the OpenStudio API? [closed]
I tried to use OpenStudio by the OpenStudio.dll in VisualStudio 2013. Therefore I install Openstudio 1.8.0 with success and open Alpha1 Example in VisualStudio. Then I copy all .dlls from the OpenStudio Directory to the /bin/debug/x86 Folder and renew the OpenStudio.dll in the Project. Now, I try to start the Example and get an error: It appears that there was an error accessing the C# SWIG Bindings for OpenStudio. Error Text: HRESULT 0x8007000B
I installed SWIG already, but I don´t know, if it´s okay, because I have a 64 Win and it exist only SWIG for 32 Win. But I execute the swig.exe. What can I do to start the Programm and to use the OpenStudio API?
Thanks a lot!!!
It sounds like you are trying to create a C# project that uses the OpenStudio C# bindings, is that correct? As Larry mentions below, the easiest way to get started using the OpenStudio API is by writing measures in Ruby. Would that meet your needs? If you really are set on writing a C# application, you will not need to have SWIG to use the bindings (SWIG is only used when generating the bindings). My best guess is that you are missing some dlls, you need all the dlls in 'C:\Program Files\OpenStudio 1.9.0\CSharp\openstudio' and 'C:\Program Files\OpenStudio 1.9.0\bin'.
Also, your build directory is '/bin/debug/x86' which indicates you are building your C# project in 32 bit mode. Try changing the project to build in 64 bit mode.
Thanks for the answer. Now I copied all he dl form the both files to the /bin/x86/debug Folder. There were only four new ones. But the Error Message still exist.
Next I tried to change to 64 bit mode and copied all the dll in the debug folder and the same error occured.
I really want to use c# because i don´t know ruby and c++. Is there another way to solve this problem?
/bin/x86/debug is where 32 bit products go, /bin/x64/debug is where 64 bit products would be. You need to copy your 64 bit dlls to that directory and run the products in there. Here are the instructions for changing your build to 64 bits.
Also, make sure to copy the project out of Program Files before building to avoid issues with file permissions.
Finally, Ruby is really not that hard to learn, especially if you already know another language like C# :-)
Thanks I know the Folders and their Meaning. I changed the Project and it still doesn´t work. I tried to work with an old OpenStudio Version. In my example I choose v.1.3.5 and this one work very well. But this is already not actaully. What could be the reason?