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 2014-11-13 09:55:58 -0600

updated 2015-07-11 13:40:54 -0600

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!

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
7

answered 2014-11-13 10:07:25 -0600

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

edit flag offensive delete link more

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 -0600 )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 -0600 )edit

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: 2014-11-13 09:55:58 -0600

Seen: 338 times

Last updated: Jan 13 '15