No, you don’t have to uninstall it. All you need to do is just download the packages from nuget (https://www.nuget.org/api/v2/package/OpenStudio/2.4.0). and change the file extension from “.nupkg” to “.zip” so that you can unzip the files.
You will find three dll files: OpenStudio.dll, openstudio_csharp.dll, and openstudio_translators_csharp.dll inside this package.
Make sure three of them are unblocked.
Just copy these three files to CSharp\openstudio folder which is inside your openstudio installation folder (usually C:\openstudio-2.4.0\CSharp\openstudio)
I have a suggestion that might be worth a shot. In the past, when my office has run into the OpenStudio.OpenStudioModelCorePINVOKE error, we found (using tools like process explorer) that our program would go to the wrong openstudio.dll (i.e if you have multiple installations or versions) and throw up this error as a result.
So a simple way to solve this is to make sure the system path searches for the openstudio.dll you want, and not going somewhere else. This can be achieved by going into your environmental variables and moving the openstudio directory to the top of your system path list.
Go into windows start tab and search and select “Edit the System Environment Variables” and then:
Environment Variables > Select Path > Edit > Select openstudio directory bin and CSharp folder > Move up
This was for work we were doing with a C# application, and not for Honeybee, but assuming the ironpython interpretor might be searching and importing for a ambiguously referenced openstudio.dll, this should work as well.
Adding the dll path to the top of python’s sys.path is easily done, and I wouldn’t be surprised if Mostapha/Chris already has code doing this internally somewhere in Honeybee. However dll reference errors are notoriously finicky and capricious so I think it’s still worth a shot to manually modify the system path.
I’ve read all the comments in here, but I am still confused… so, there is no solution for this problem yet?
I am working in 2 different computers: my own and another one from the lab. And I am also getting the mentioned error when I try to use this component.
In my first model, I applied Ideal Loads as my HVAC system. It was able to run in E+, but I couldn’t export my model to OS 2.5 through this component. I got this error message in my computer:
Then I realized that even though I had set my heating and cooling setpoints in “Set EnergyPlus Zone Thresholds” with some values, in my IDF file they are automatically replaced by 0 (even though I don’t use this component, in my IDF file I get Constant Heating/Cooling setpoint 0). In my simulation through E+, it seems that the program bypasses the constant heating/cooling setpoints and uses a schedule that I created based on my heating and cooling setpoints, using the setpoint temperatures. So, it works.
So, is there a problem with this “Set EnergyPlus Zone Thresholds” component? It seems that it’s not being read in my case… Or, should HB always automatically set constant cooling/heating setpoints to 0?
Does it have something related to “Export to OS” component not working?
In order to assign another HVAC system to my model, I need to be able to export my model to OS, right? I’ve tried to run a simulation with a Fan Coil + DOAS system through HB, but the “Run E+” component gives me a message saying that it automatically replaced my HVAC with Ideal Loads and that if I needed to use another system, I should be able to export it to OS. So, is there another way I can get this HVAC system working? Or fix “Export to Open Studio”…
Yes, you need to use export to OpenStudio cponeny to have HVAC systems exported.
OpenSudios’s IDF import only brings in some of the features from the idf like geometry and constructions. It strips out all HVAC systems and thermostats
The PINVOKE error is an issue that exists on OpenStudio team’s end and you can see a lot of github documentation about it. If it was something that we had the power to fix, you can bet that we would have addressed it already. We’ve gotten OpenStudio team to say that they’ll make a utility that installs with OpenStudio to help diagnose the issue.
You see on your second computer that you don’t get the PINVOKE issue because this issue only affects a small percentage of computers. The reason why you get an error there is because of a mismatch between the version of your Honeybee_Honeybee and the OpenStudio component. If you can’t solve it on your own, open a separate issue than the one here since that error has nothing to do with PINVOKE.
Hi there, apologies for the radio silence. We have tried all the above but nothing seems to work.
We also tried a fresh installation of both OpenStudion 2.5.0 and 2.5.1, on a brand new machine, which also didn’t work. The PINVOKE issue persists.
Has anyone ever managed to run openstudio V2.5.0 (i.e. E+ V8.9.0) through HoneyBee?
I just wanted to make a (hopefully useful) conclusion here based on all of this discussion. Given what people have tried here and my personal experience teaching HB energy model workflows, it seems very clear that certain versions of OpenStudio are less prone to the PINVOKE error than others.
Notably, @mostapha and I have taught several workshops with OpenStudio 2.4 and we have yet to encounter an PINVOKE error with any of the participants. So this seems to be a more stable version.
All of this said, the discussion here is evidence that some people still experience the PINVOKE error in OpenStudio 2.4 but, for these cases, it seems that OpenStudio 1.14 is able to run without the PINVOKE error.
While this isn’t a perfect solution, it seems like the best that we can offer now until OpenStudio team figures out what is causing this issue.
for this example file i need openstudio i have latest version installed but same PINVOKE error. After reading your comment uninstalled latest and installed old version as mentioned but after that, the file says no Openstudio found even though when i have old one installed. Any idea what to do now.
You definitely don’t want to go all of the way back to OpenStudio 1. I suggest either OpenStudio 2.9.1 (if you want something that works out of the box) or OpenStudio 3.0.0 (if you want the latest and greatest and are willing to follow the steps in the link aobve)