Photography
DescriptionThis code editor allows creating and modifying Ruby scripts within SketchUp. These scripts can be used to create geometry, add functionality or add data within the SketchUp 3D modeling environment.
This editor is an extension of Jim Folz’s excellent Web Console plugin.
I created this version of the editor mainly for two reasons: One is that when I code, I permanently need to look up documentation. To fix this, I added a bunch of reference webpages to a browser in a tab. Also, a dropdown above the editor contains some common code snippets that can be inserted at the current cursor position.
The other reason is that I wanted it to behave a bit more like a real code editor, so I added a bit of jQuery magic to make it look good and have some additional features. While it still isn’t a full-fledged code editor (with syntax highlighting, autocomplete etc.), it is actually quite functional for smaller projects. In the 1.1 version, you can also set your user interface preference (light, dark or blue).
At this point, this editor has the following features:
SketchUp Ruby Code Editor v.1.1.2 (195.26 KB, downloaded 321 times) - PLEASE NOTE: Download the ZIP file and unzip it into the SketchUp plugin directory (usually at C:\Program Files\Google\SketchUp\Plugins\ in Windows). Then re-start SketchUp and look for the new menu item in the Plugins menu. If you are updating, just overwrite the old version of this plugin.
Main editor window with snippets dropdown shown
Main editor window with dark UI
Browser tab with links shown
Win7-style split-view of editor and SU
Options page (dark UI)
About page
In addition to Jim’s original code and whatever I added and modified, this editor uses the jQuery and jQuery UI libraries. I am also grateful for comments and suggestions from Dan Rathbun and others at SCF.
Great idea!
To get your sample code to work I had to add "Math." to sin function to prevent the error:
(eval):9:in ‘initialize’: undefined method ‘sin’ for #<WebConsole:0×6e6d5d8>
Interesting. It works fine for me. Are you on a Mac?
Dan, it (whatever you may call it (not a SU-tool though!)) was mentioned to show up in the Tools menu. Thats why my insignificant remark. Of course I found it where it should be. And later I checked the code where it is send to.
I can't catch up with you guys but at least that I could figure out.
Cheers.
OK.. gotcha.Sorry.. my bad! (I missed the typo.)
Alexander,
Hi, I'm Gerrit Hubers / Wo3Dan on the SU forums. Thanks for making this script/editor. Hopefully it's going to help me in getting to know how to write (simple) ruby scripts for SU. I liked Jim's Web Console for it was integrated in SU's environment. For me that's essential for understanding what happens when, when trying/altering snippets. So I'm really excited about this tool!!!
One verrrrrrry small remark from a simple futur user. Your tool shows up in the 'Plugins' folder in SU, not in the 'Tools' folder.
Thanks again,
Gerrit
Edit: Your tool shows up in the 'Plugins' menu in SU, not in the 'Tools' menu in SU.
Oops! Just a typo. Thanks for catching it. Of course the tool appears in the "Plugins" menu.
Because it's not a Tool. (Like a Pencil or Protractor.) It's a Utility (and in the Ruby subcatagory.)