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

load custom scripts in Sketchup

asked 6 years ago

updated 6 years ago

OpenStudio v2.4.0 > Sketchup PlugIn

Appear to be having difficulty getting User Scripts to load in the Sketchup Plugin. The 'Load User Scripts' also doesn't appear to help in the matter. I have located the right directory, as my 'new folder' shows up in the drop down menus: Extensions > OpenStudio User Scripts > zCustom Scripts> ....then this is empty. Even If I copy/paste one of the preloaded user scripts into the folder. So, what am I missing here?

Second / follow on. It appears that the OS plug-in doesn't appear in my Roaming profile where all my other SU Extensions live. How does OS plug in know its to be loaded then? Is it possible to switch between versions of the OS SU plugin if this can be load/unloaded?

Preview: (hide)

Comments

@dradair I assume quitting and re-starting SketchUp didn't help either. I can't remember if "Load User Scripts" just re-load existing scripts or also loads new scripts.Also can you specify what version of SketchUp you are using and what operating system. Then I can try to duplicate what you are seeing.

David Goldwasser's avatar David Goldwasser  ( 6 years ago )

Sketchup 2017 Pro. restarting Sketchup allowed the new directory I created to show up, but the menu was empty. I have 2 scripts saved into that folder; one a copy of a script that comes with OS, another is a renamed copy of the script (just to test this). Is there some need/means to 'register' a measure within OpenStudio PlugIn/Sketchup? Or where should these scripts be saved/loaded for use in the plug in?

dradair's avatar dradair  ( 6 years ago )

1 Answer

Sort by » oldest newest most voted
4

answered 6 years ago

updated 6 years ago

When you renamed the copied script, did you change the actual class name in the script? Try creating a new script with:

class Testscript < OpenStudio::Ruleset::ModelUserScript
  def name
    return "Test"
  end
end

Testscript.new.registerWithApplication

After a restart you should see it. I suspect you didn't before because the application had already loaded a script with the name in your copied files.

Preview: (hide)
link

Comments

@Eric Ringold gets a gold star. I had forgotten the: Testscript.new.registerWithApplication part.

follow on - I had found where my scripts were for my install ( C:\openstudio-2.4.0\SketchUpPlugin\openstudio\sketchup_plugin\user_scripts). Is this 'default'? is there a means to change where OS/SU looks for these scripts?

dradair's avatar dradair  ( 6 years ago )

You could try messing around hereabouts

ericringold's avatar ericringold  ( 6 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

2 followers

Stats

Asked: 6 years ago

Seen: 293 times

Last updated: Sep 14 '18