First time here? Check out the Help page!

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

How to access openstudio model via Sketchup 2021 ruby console?

asked 3 years ago

TomB's avatar

updated 3 years ago

whereas in Sketchup 2017

model = Sketchup.active_model.model_interface.openstudio_model

in Sketchp 2021, the above returns an error message saying something like 'no such thing as .model_interface'.

I guess the Sketchup SDK changed.

Whats the new magic words to get to the openstudio model?

Preview: (hide)

1 Answer

Sort by » oldest newest most voted
3

answered 3 years ago

Try OpenStudio::Plugin.model_manager.model_interface.openstudio_model or OpenStudio::get_model_interface(Sketchup.active_model).openstudio_model. That was a change SketchUp requested, they didn't like plug-ins adding methods to their SketchUp Model class.

Preview: (hide)
link

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: 3 years ago

Seen: 924 times

Last updated: Feb 17 '22