Skip to content
This repository has been archived by the owner on Sep 17, 2018. It is now read-only.

Wikihouse Extension 0.2 Dev #4

Open
wants to merge 31 commits into
base: master
Choose a base branch
from
Open

Wikihouse Extension 0.2 Dev #4

wants to merge 31 commits into from

Conversation

MrKriss
Copy link

@MrKriss MrKriss commented Apr 30, 2013

Ok, so I have made quite a lot of changes to the code, though mostly for (re)organisation purposes. All has been tested on Mac OS and works fine, but not yet tested on Windows.

New Features:

  • Wikihouse now loadable as a Sketchup Extension.
  • Settings Menu added to custimise sheet dimentions.

List of Changes:

  • Split the main Wikihouse.rb file into multiple files of related code located in the wikihouse_extension/lib/ directory.
  • Wrapped the whole code into a Ruby module called WikihouseExtension, thereby protecting against any namespace clashes in the future.
  • wikihouse_extension_loader.rb script now contains all the configuration constants such as paths, platform, and run flags which are most likely to be changed between runs.
  • All utility functions are now in the file utils.rb along with any other perminant constants.
  • All output writer classes moved to a file called writers.rb.
  • All WebDialoge moved to WebDialog.rb.
  • Added a hash $wikihouse_settings as a global variale to store all variable configureation/settup data.
  • Any code that is not currently functional is in other.rb.
  • Added methods to convert Ruby Hash and Array classes to JSON strings and vice versa. This provides a more flexible bridge between Ruby and JavaScript in the Web Dialogues.
  • Added a changes log file.

MrKriss added 30 commits March 14, 2013 18:02
short script to add the plugin as a SketchUp Extension. Also updated
README install instructions.
make release should upload following to Amazon S3
bucket: wikihouse_extension.rbz and wikihouse_extension-{git-rev}.rbz

Included .gitignore for .rbz files.

Renamed all instances of plugin to extension for clarity.

Updated install instruction in README
namespace recalling between different files of ruby code.

Beginning to split up wikihouse.rb into smaller files of related code. 

Run flags and config constants now in wikihouse_extension_loader before
extension is loaded.

Extra constants now in constants.rb
Utility functions and classes now in utils.rb
Output writters now in writers.rb

SVG output currently has an error. Investigating.
object strings. Used in parsing data to web dialogues.
'@@wikihouse_settings' to store variable info.
These
will update all files in necessary plugin folders. Note folders must
already exist.
check in SU 2013 that was throwing an error on loading plugin.

if File.size(model_path) > 12582912
reply = UI.messagebox "The model file is larger than 12MB. Would you like to purge unused objects, materials and styles?", MB_OKCANCEL
if reply == REPLY_OK
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There is already constants for the return values of UI.messagebox: MB_OK. See http://www.sketchup.com/intl/en/developer/docs/ourdoc/ui.php#messagebox

@thomthom
Copy link

thomthom commented Aug 6, 2013

Maybe I should introduce myself, considering I just flooded this pull request with comments. My name is Thomas Thomassen and I'm a new member of the SketchUp Extensibility Team, just started a couple of days ago. Wanted to give some advice and pointers.
I'm looking at the rest of the code as well.

join()
result = eval(ruby_string)
return result
rescue Exception => e
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

One shouldn't normally catch Exception - instead StandardError. http://www.skorks.com/2009/09/ruby-exceptions-and-exception-handling/

@tav
Copy link
Owner

tav commented Aug 6, 2013

Thanks for the awesome code review @thomthom! 👍

Will definitely incorporate most of it when I eventually get round to merging and cutting the next release.

Thanks again!

@thomthom
Copy link

thomthom commented Aug 7, 2013

Btw, I'm also the developer of "Milling Tools", the extensions that let you create dog-bone corners. I can assist on making the code from the reusable for your usage.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants