It is currently Thu Sep 02, 2010 10:04 pm

Registration
Login Help

Advertise Here

New API doc - typos and questions

FAQMembersRegisterLogin

New API doc - typos and questions

Postby thomthom on Thu Feb 26, 2009 8:11 pm

I'm looking at the new API docs and I noted an inconsistency in the documentation. I thought we might collect them here as they're discovered and hopefully we'll see them addressed.

The example for Set.include? http://code.google.com/apis/sketchup/do ... ml#include? uses a different method name:
Code: Select all
status = set.contains? object
Thomas Thomassen — SketchUp Monkey
My Plugins
User avatar
thomthom
Global Moderator
 
Posts: 8353
Joined: Tue Nov 13, 2007 12:47 pm
Location: Trondheim, Norway
Name: Thomas Thomassen
Operating system: Windows7/Vista/XP/OSX10.4/10.5
SketchUp version: 6.4&7.1&8 Pro

Re: New API doc - typos and questions

Postby thomthom on Thu Feb 26, 2009 8:21 pm

Vector3d.linear_combination
http://code.google.com/apis/sketchup/do ... ombination

In addition to the 4-argument form detailed here, you may also call this method with 6 parameters in the form of:

Arguments:
weight1 - A weight or percentage.
vector1 - The first vector.
weight2 - A weight or percentage.
vector2 - The end point of the line.

What's the two extra arguments?
Thomas Thomassen — SketchUp Monkey
My Plugins
User avatar
thomthom
Global Moderator
 
Posts: 8353
Joined: Tue Nov 13, 2007 12:47 pm
Location: Trondheim, Norway
Name: Thomas Thomassen
Operating system: Windows7/Vista/XP/OSX10.4/10.5
SketchUp version: 6.4&7.1&8 Pro

Re: New API doc - typos and questions

Postby Chris Fullmer on Thu Feb 26, 2009 9:09 pm

Jim just pointed out this method and I noticed its missing:

Code: Select all
Face.get_glued_instances
Your intelligence will never fully compensate for my stupidity.
Cal Poly Pomona - BS Landscape Architecture
UC Berkeley - Masters of Landscape Architecture
All my Plugins I've written
chrisfullmer.com - Art Blog
User avatar
Chris Fullmer
Global Moderator
 
Posts: 4760
Joined: Wed Nov 21, 2007 3:21 am
Location: Davis, CA
Name: Chris Fullmer
Operating system: Windows Vista
SketchUp version: 7.1x

Re: New API doc - typos and questions

Postby avariant on Thu Feb 26, 2009 11:22 pm

I'm pretty certain the material observer is completely wrong. The base class defines all but two methods incorrectly, and doesn't appear to use them all that correctly either.
avariant
 
Posts: 89
Joined: Sat May 03, 2008 6:00 pm

Re: New API doc - typos and questions

Postby ScottLininger on Thu Feb 26, 2009 11:31 pm

Hello everyone,

Yes, we just launched some new docs for the Ruby API on the code site. These are the most accurate and up to date documentation we have ever had, and we hope that they are useful. (That being said, there is obviously still room for improvement.)

Your help in finding typos/missing details are very welcome! What isn't evident just from glancing at the site is that we have a new process internally for maintaining and updating the docs that will help us be more responsive to changes from here on out. (ThomThom, I've already pulled in your questions/corrections and will be pushing them out soon.)

By the way, HUGE thanks must be given to the people who worked on the wiki-enabled docs over the last couple of years. We integrated those community changes, and I'm currently doing a review to make sure that any changes from the last couple months are reflected in the new docs. Thank you! (The wiki docs are still up for now, and I will continue to monitor them for fixes.)

http://code.google.com/apis/sketchup/

Keep the corrections coming!
- Scott Lininger
SketchUp Software Engineer
Have you visited the Ruby API Docs?
ScottLininger
Google SketchUp Team
 
Posts: 155
Joined: Tue Oct 21, 2008 11:17 pm
Location: Boulder, CO

Re: New API doc - typos and questions

Postby ScottLininger on Fri Feb 27, 2009 12:31 am

Chris Fullmer wrote:Jim just pointed out this method and I noticed its missing:

Code: Select all
Face.get_glued_instances


Hey Chris (or Jim),

I don't think that's a standard method... (am I wrong?) I went to go add it to the docs, but I can't find it. Maybe it's part of some script out there?

Let me know, :)
- Scott Lininger
SketchUp Software Engineer
Have you visited the Ruby API Docs?
ScottLininger
Google SketchUp Team
 
Posts: 155
Joined: Tue Oct 21, 2008 11:17 pm
Location: Boulder, CO

Re: New API doc - typos and questions

Postby Chris Fullmer on Fri Feb 27, 2009 12:37 am

Scott, I have question. This is coming from me, and I have little understanding of this documentation stuff. But is the SU Ruby code documented in a similar way to rDoc or something? Is it set up so that you guys can change the documentation, then run some rDoc like command on it and it automatically updates the website? Does that make sense?

Also, I like the tag that shows what version of SU each method is compatible with :)

Chris
Your intelligence will never fully compensate for my stupidity.
Cal Poly Pomona - BS Landscape Architecture
UC Berkeley - Masters of Landscape Architecture
All my Plugins I've written
chrisfullmer.com - Art Blog
User avatar
Chris Fullmer
Global Moderator
 
Posts: 4760
Joined: Wed Nov 21, 2007 3:21 am
Location: Davis, CA
Name: Chris Fullmer
Operating system: Windows Vista
SketchUp version: 7.1x

Re: New API doc - typos and questions

Postby remus on Fri Feb 27, 2009 12:43 am

[ruby newb]i thought the face.get_glued_instances method was added with the latest M1 release?[/ruby newb]
User avatar
remus
Global Moderator
 
Posts: 7995
Joined: Fri Nov 30, 2007 8:48 am
Location: UK
Name: remus
Operating system: vista
SketchUp version: 7.whatever

Re: New API doc - typos and questions

Postby ScottLininger on Fri Feb 27, 2009 12:57 am

Chris Fullmer wrote:But is the SU Ruby code documented in a similar way to rDoc or something? Is it set up so that you guys can change the documentation, then run some rDoc like command on it and it automatically updates the website?


Yes.

We now generate the docs directly from source code comments, using something like rdoc. So we make a change to the source. It gets code reviewed and checked in. Then we push a button and it all goes onto the new site.

So... there are likely some "autogeneration" bugs that we will all discover over the coming weeks. Not to mention plain old human error. Which, by the way, is why the get_glued_instances method isn't up there. Remus is right, that was added with M1 and I am a bonehead. Fix coming! ;)

Thx,
- Scott Lininger
SketchUp Software Engineer
Have you visited the Ruby API Docs?
ScottLininger
Google SketchUp Team
 
Posts: 155
Joined: Tue Oct 21, 2008 11:17 pm
Location: Boulder, CO

Re: New API doc - typos and questions

Postby ScottLininger on Fri Feb 27, 2009 1:11 am

avariant wrote:I'm pretty certain the material observer is completely wrong. The base class defines all but two methods incorrectly, and doesn't appear to use them all that correctly either.


Attached script demonstrates using the MaterialsObserver as documented. The base class may not have all of the methods correctly implemented, but SketchUp will call them.

As the docs say, the onMaterialRemoveAll does not fire in a particularly useful way.

Let me know if you find anything else! Thanks!
You do not have the required permissions to view the files attached to this post.
- Scott Lininger
SketchUp Software Engineer
Have you visited the Ruby API Docs?
ScottLininger
Google SketchUp Team
 
Posts: 155
Joined: Tue Oct 21, 2008 11:17 pm
Location: Boulder, CO

Re: New API doc - typos and questions

Postby avariant on Fri Feb 27, 2009 2:03 am

I guess my blanket comments about the MaterialObserver were not entirely accurate ;) I was under the impression that unless some of the methods weren't explicitly implemented in the observer, SU would crash when it attempted to call the method since it's not implemented on the base. However, I seem to be wrong. :oops:
The documentation on onMaterialChange is a little inadequate. It says it is called whenever a material is altered, but it doesn't get called when you change size or color, just texture.
avariant
 
Posts: 89
Joined: Sat May 03, 2008 6:00 pm

Re: New API doc - typos and questions

Postby Jim on Fri Feb 27, 2009 3:00 am

ScottLininger wrote:
Chris Fullmer wrote:Jim just pointed out this method and I noticed its missing:

Code: Select all
Face.get_glued_instances


Hey Chris (or Jim),

I don't think that's a standard method... (am I wrong?) I went to go add it to the docs, but I can't find it. Maybe it's part of some script out there?

Let me know, :)


Scott, I got the information from the Release Notes page.
I probably over-simplified that.
sketchup plugins & news blog
Jim
 
Posts: 2876
Joined: Mon Nov 12, 2007 10:13 pm
Name: Jim Foltz
Operating system: XP Pro SP3
SketchUp version: Google Pro 8.0

Re: New API doc - typos and questions

Postby thomthom on Fri Feb 27, 2009 9:16 am

Noticed in another thread that there seem to be some deviation related to send_action. viewtopic.php?f=180&t=16751&start=15#p135201

"selectCameraOrbitTool:" doesnt work.
It's action name is simply OrbitTool.

Seems to be a couple more as well.
Thomas Thomassen — SketchUp Monkey
My Plugins
User avatar
thomthom
Global Moderator
 
Posts: 8353
Joined: Tue Nov 13, 2007 12:47 pm
Location: Trondheim, Norway
Name: Thomas Thomassen
Operating system: Windows7/Vista/XP/OSX10.4/10.5
SketchUp version: 6.4&7.1&8 Pro

Re: New API doc - typos and questions

Postby Todd Burch on Fri Feb 27, 2009 1:31 pm

ScottLininger wrote:Hello everyone,

Yes, we just launched some new docs for the Ruby API on the code site. These are the most accurate and up to date documentation we have ever had, and we hope that they are useful. (That being said, there is obviously still room for improvement.)



Thanks Scott!
User avatar
Todd Burch
 
Posts: 836
Joined: Mon Nov 12, 2007 2:43 pm
Location: Katy, Texas
Operating system: Win XP and MAC OS X
SketchUp version: V4, V5, V6, V7

Re: New API doc - typos and questions

Postby thomthom on Fri Feb 27, 2009 2:39 pm

Under the UI Classes section:
Tool, Toolbar and Webdialog all links to the Array class: http://code.google.com/apis/sketchup/do ... array.html
Thomas Thomassen — SketchUp Monkey
My Plugins
User avatar
thomthom
Global Moderator
 
Posts: 8353
Joined: Tue Nov 13, 2007 12:47 pm
Location: Trondheim, Norway
Name: Thomas Thomassen
Operating system: Windows7/Vista/XP/OSX10.4/10.5
SketchUp version: 6.4&7.1&8 Pro

SketchUcation One-Liner Adverts

by Ad Machine on 5 minutes ago

Driving Dimensions - History-free parametric design in Google SketchUp
Ad Machine
Robot
 
Posts: 2010

Next

 

Advertise Here

Who is online

Users browsing this forum: No registered users and 1 guest