• Login
sketchucation logo sketchucation
  • Login
ℹ️ GoFundMe | Our friend Gus Robatto needs some help in a challenging time Learn More

New API doc - typos and questions

Scheduled Pinned Locked Moved Developers' Forum
370 Posts 35 Posters 256.4k Views
Loading More Posts
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • T Offline
    thomthom
    last edited by 26 Feb 2009, 19:11

    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/docs/ourdoc/set.html#include ? uses a different method name:

    status = set.contains? object
    

    Thomas Thomassen — SketchUp Monkey & Coding addict
    List of my plugins and link to the CookieWare fund

    1 Reply Last reply Reply Quote 0
    • T Offline
      thomthom
      last edited by 26 Feb 2009, 19:21

      Vector3d.linear_combination
      http://code.google.com/apis/sketchup/docs/ourdoc/vector3d.html#linear_combination

      @unknownuser said:

      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 & Coding addict
      List of my plugins and link to the CookieWare fund

      1 Reply Last reply Reply Quote 0
      • A Offline
        avariant
        last edited by 26 Feb 2009, 22:22

        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.

        1 Reply Last reply Reply Quote 0
        • S Offline
          scottlininger
          last edited by 26 Feb 2009, 22:31

          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?
          1 Reply Last reply Reply Quote 0
          • C Offline
            Chris Fullmer
            last edited by 26 Feb 2009, 23:05

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

            Face.get_glued_instances
            

            Lately you've been tan, suspicious for the winter.
            All my Plugins I've written

            1 Reply Last reply Reply Quote 0
            • S Offline
              scottlininger
              last edited by 26 Feb 2009, 23:31

              @chris fullmer said:

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

              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?
              1 Reply Last reply Reply Quote 0
              • R Offline
                remus
                last edited by 26 Feb 2009, 23:43

                i thought the face.get_glued_instances method was added with the latest M1 release?

                http://remusrendering.wordpress.com/

                1 Reply Last reply Reply Quote 0
                • S Offline
                  scottlininger
                  last edited by 26 Feb 2009, 23:57

                  @chris fullmer said:

                  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?
                  1 Reply Last reply Reply Quote 0
                  • C Offline
                    Chris Fullmer
                    last edited by 26 Feb 2009, 23:58

                    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

                    Lately you've been tan, suspicious for the winter.
                    All my Plugins I've written

                    1 Reply Last reply Reply Quote 0
                    • S Offline
                      scottlininger
                      last edited by 27 Feb 2009, 00:11

                      @avariant said:

                      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!


                      materialsObserverTest.rb

                      • Scott Lininger
                        SketchUp Software Engineer
                        Have you visited the Ruby API Docs?
                      1 Reply Last reply Reply Quote 0
                      • A Offline
                        avariant
                        last edited by 27 Feb 2009, 01:03

                        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. 😳
                        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.

                        1 Reply Last reply Reply Quote 0
                        • J Offline
                          Jim
                          last edited by 27 Feb 2009, 02:00

                          @unknownuser said:

                          @chris fullmer said:

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

                          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.

                          Hi

                          1 Reply Last reply Reply Quote 0
                          • T Offline
                            thomthom
                            last edited by 27 Feb 2009, 08:16

                            Noticed in another thread that there seem to be some deviation related to send_action. http://www.sketchucation.com/forums/scf/viewtopic.php?f=180&t=16751&start=15#p135201

                            @unknownuser said:

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

                            Seems to be a couple more as well.

                            Thomas Thomassen — SketchUp Monkey & Coding addict
                            List of my plugins and link to the CookieWare fund

                            1 Reply Last reply Reply Quote 0
                            • T Offline
                              todd burch
                              last edited by 27 Feb 2009, 12:31

                              @unknownuser said:

                              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!

                              1 Reply Last reply Reply Quote 0
                              • T Offline
                                thomthom
                                last edited by 27 Feb 2009, 13:39

                                Under the UI Classes section:
                                Tool, Toolbar and Webdialog all links to the Array class: http://code.google.com/apis/sketchup/docs/ourdoc/array.html

                                Thomas Thomassen — SketchUp Monkey & Coding addict
                                List of my plugins and link to the CookieWare fund

                                1 Reply Last reply Reply Quote 0
                                • S Offline
                                  scottlininger
                                  last edited by 28 Feb 2009, 06:17

                                  A bunch of fixes got pushed on Friday. Thanks again to folks who found typos, both from this thread and from the wiki documentation. Keep 'em coming!

                                  I'm on vacation for the next week, so don't think I'm ignoring anyone if I don't reply for a few days. Thanks, guys!

                                  • Scott Lininger
                                    SketchUp Software Engineer
                                    Have you visited the Ruby API Docs?
                                  1 Reply Last reply Reply Quote 0
                                  • T Offline
                                    thomthom
                                    last edited by 1 Mar 2009, 09:39

                                    Thanks Scott.

                                    I'm still puzzled about the six arguments for Vector3d.linear_combination.

                                    vec = Geom;;Vector3d.linear_combination(x, xaxis, y, yaxis, z, zaxis)
                                    

                                    How does this really work?

                                    Thomas Thomassen — SketchUp Monkey & Coding addict
                                    List of my plugins and link to the CookieWare fund

                                    1 Reply Last reply Reply Quote 0
                                    • C Offline
                                      Chris Fullmer
                                      last edited by 1 Mar 2009, 16:45

                                      Not to mention that the example at the bottom of the method does not actually include the method of linear combination. It only shows:

                                       vector1 = Geom;;Vector3d.new 1,0,0
                                       vector2 = Geom;;Vector3d.new 0,1,0
                                      

                                      Lately you've been tan, suspicious for the winter.
                                      All my Plugins I've written

                                      1 Reply Last reply Reply Quote 0
                                      • C Offline
                                        Chris Fullmer
                                        last edited by 1 Mar 2009, 21:02

                                        PolygonMesh.add_polygon

                                        The example shows how to use the add_point method.

                                        Lately you've been tan, suspicious for the winter.
                                        All my Plugins I've written

                                        1 Reply Last reply Reply Quote 0
                                        • T Offline
                                          thomthom
                                          last edited by 1 Mar 2009, 21:09

                                          Wish we had red pens to scribble on the docs. 😄

                                          Thomas Thomassen — SketchUp Monkey & Coding addict
                                          List of my plugins and link to the CookieWare fund

                                          1 Reply Last reply Reply Quote 0
                                          • 1
                                          • 2
                                          • 3
                                          • 4
                                          • 5
                                          • 18
                                          • 19
                                          • 1 / 19
                                          1 / 19
                                          • First post
                                            20/370
                                            Last post
                                          Buy SketchPlus
                                          Buy SUbD
                                          Buy WrapR
                                          Buy eBook
                                          Buy Modelur
                                          Buy Vertex Tools
                                          Buy SketchCuisine
                                          Buy FormFonts

                                          Advertisement