4

GBXML Class in OpenStudio Ruby SDK

I'm trying to use the OpenStudio Ruby SDK to import with GbXML. I get a "NameError: unitialized constant" error with

OpenStudio::GbXML::ReverseTranslator.new()

If I enter the EnergyPlus translator command it works.

OpenStudio::EnergyPlus::ReverseTranslator.new()

Creating an instance of the GbXML class also works fine.

OpenStudio::GbXML

Am I missing something in the syntax or is this class somehow missing from the Ruby SDK? Thanks for the help!

jmcneill's avatar
1.7k
jmcneill
asked 2014-11-13 09:55:58 -0500
__AmirRoth__'s avatar
4.4k
__AmirRoth__
updated 2015-07-11 13:40:54 -0500
edit flag offensive 0 remove flag close merge delete

Comments

add a comment see more comments

1 Answer

7

Hey @jmcneill this is a good question and one that we don't really have documented well. Basically we found issues with our Ruby and C# bindings when we had classes with the same name but in different namespaces/modules. This should be ok but rather than than fight, we simply renamed ReverseTranslator in the gbXML module to GbXMLReverseTranslator:

https://github.com/NREL/OpenStudio/bl...

So in your code you would just do this instead:

OpenStudio::GbXML::GbXMLReverseTranslator.new()

HTH, Dan

macumber's avatar
12k
macumber
answered 2014-11-13 10:07:25 -0500
edit flag offensive 0 remove flag delete link

Comments

1

Thanks for the speedy response @macumber! Is there a specific place to go to for learning any difference with the Ruby vs C++ SDKs? I was even having a bit of trouble figuring out what capitalization syntax you might use for GbXML...

jmcneill's avatar jmcneill (2014-11-13 10:11:53 -0500) edit
1

Unfortunately there is not right now. The Ruby bindings are essentially the same as the C++ SDK, any differences are due to code in the *.i files. So the best place to look right now is in the *.i files in the source code near the classes you are interested in. You can also ask questions here :-) Sorry there isn't a better answer for now.

macumber's avatar macumber (2014-11-13 20:07:07 -0500) edit
add a comment see more comments