Question-and-Answer Resource for the Building Energy Modeling Community
Get started with the Help page
Ask Your Question
4

GBXML Class in OpenStudio Ruby SDK

asked 10 years ago

updated 9 years ago

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!

Preview: (hide)

1 Answer

Sort by » oldest newest most voted
7

answered 10 years ago

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

Preview: (hide)
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  ( 10 years ago )
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  ( 10 years ago )

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Training Workshops

Careers

Question Tools

1 follower

Stats

Asked: 10 years ago

Seen: 343 times

Last updated: Jan 13 '15