19.12.2016 Views

Architectural_Design_with_SketchUp

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

Appendix D Creating Your Own Plugins<br />

# do something...<br />

end<br />

end<br />

# Create menu items<br />

unless file_loaded?(__FILE__)<br />

mymenu = UI.menu(“Plugins”).add_submenu(“My Plugin Collection”)<br />

mymenu.add_item(“My Tool 1”) {My_module::my_method}<br />

mymenu.add_item(“My Tool 2”) {My_module::my_second_method}<br />

file_loaded(__FILE__)<br />

end<br />

If you prefer not to have your plugin’s source code visible, then you can use <strong>SketchUp</strong>’s<br />

Scrambler to encrypt Ruby files. You can download it from here:<br />

https://developers.google.com/sketchup/docs/utilities<br />

TIP<br />

293

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!