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 2018-09-13 15:33:50 -0500

updated 2018-09-13 15:34:58 -0500

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?

edit retag flag offensive close merge delete

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 gravatar imageDavid Goldwasser ( 2018-09-13 20:19:08 -0500 )edit

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 gravatar imagedradair ( 2018-09-14 07:41:31 -0500 )edit

1 Answer

Sort by ยป oldest newest most voted
4

answered 2018-09-14 10:22:24 -0500

updated 2018-09-14 10:22:57 -0500

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.

edit flag offensive delete link more

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 gravatar imagedradair ( 2018-09-14 11:07:38 -0500 )edit

You could try messing around hereabouts

Eric Ringold gravatar imageEric Ringold ( 2018-09-14 11:22:58 -0500 )edit

Your Answer

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

Add Answer

 



Question Tools

2 followers

Stats

Asked: 2018-09-13 15:33:50 -0500

Seen: 50 times

Last updated: Sep 14