post moved
@wsellers89 said:
Is there a good reference or tutorials for learning more about Ruby on SketchUp?
Free downloadable PDF version of "Automatic SketchUp" at Google Docs (Look for the download link in the upper-left of toolbar.)
EDIT: As of JULY 2010 Google reports "Sorry, the page (or document) you have requested is not available." Try the author's website: Automatic Sketchup
You ALSO need to learn some standard Ruby, the old 'Pick-Axe' book "The Pragmatic Programmer's Guide: Programming Ruby"
http://phrogz.net/ProgrammingRuby/frameset.html
(There is a tar download link at the bottom of the left pane.)
@wsellers89 said:
I am experienced in Fortran and to a less extent C, but I can follow most of the the code.
The weirdest thing about Ruby (and it's kept secret from newbies, I guess to surprise them in the advanced course?,) is that Ruby has no actual variables like BASIC, Pascal, or FORTRAN. Read this post for more info:
[url=http://forums.sketchucation.com/viewtopic.php?f=180&t=26437#p230201:2y8qpfiu]By value or by reference?[/url:2y8qpfiu]
I personally would ALWAYS tell experienced programmers about this FIRST thing, as it can and has led to much wasted time and frustration.
@wsellers89 said:
I am not sure what ".to_f" does in the loop to parse out the x,y points and would like to know more.
Converts the object (on the left of the dot,) to a Float class.
This is one of the standard Ruby instance methods.
[url=http://phrogz.net/ProgrammingRuby/builtins.html#builtinclassesandmethods:2y8qpfiu]Built-In Class and Methods[/url:2y8qpfiu]
This old 'Pick-Axe' version was written for Ruby 1.6.x, but still helps alot. Sketchup is using the 1.8.x branch, but the book is still say 95% valid. Ver 1.8.x renamed a few Exceptions, added some more methods, etc. (There are updated hardcopy books available for sale for the 1.8.x and 1.9.x branch. Check booksellers or Ebay.)
Other Topics here at SketchUcation on Ruby Programming:
[url=http://forums.sketchucation.com/viewtopic.php?f=180&t=10142:2y8qpfiu]SketchUp-Ruby Resources[/url:2y8qpfiu]
[url=http://forums.sketchucation.com/viewtopic.php?f=180&t=20427:2y8qpfiu]Developer Forum Sticky Links[/url:2y8qpfiu]
[url=http://forums.sketchucation.com/viewtopic.php?f=180&t=27606:2y8qpfiu]Ruby Docs[/url:2y8qpfiu] this topic
(pssst! You can bookmark topics and access your bookmarks through your User Control Panel. The link is a the top left of each forum just below the list of Moderators. The bookmark button is hidden all the way at the bottom of each topic webpage in the footerbar.)