• Login
sketchucation logo sketchucation
  • Login
🤑 SketchPlus 1.3 | 44 Tools for $15 until June 20th Buy Now

[ruby doc] Model - undocumented methods

Scheduled Pinned Locked Moved Developers' Forum
8 Posts 7 Posters 2.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.
  • A Offline
    azuby
    last edited by 3 Feb 2008, 12:24

    OK, first of all an one-liner to get all methods from the active model (-> form a Model object):

    puts((Sketchup.active_model.methods-Object.methods).sort)
    

    I'm running Windows XP, Sketchup 6.4.112

    Two of the methods are not documented

    • get_product_family - returns 3 - maybe it returns which kind of product (free or pro version) the user is running
    • skpdoc - returns 170625304, 170625368 or 170744800 - I really don't know, what this one is used for und returns, but the number is different after each Sketchup restart
      azuby

    *error initus :: Blocks | CurrentDate | d/Code | extensionmanager | FFlipper | HideEdges | MeasuredArea | ModelHistory | PluginsHelp | PronButton | SAWSO | SCP | SU²CATT

    Bad English? PM me, correct me. :smile:**

    1 Reply Last reply Reply Quote 0
    • T Offline
      tbd
      last edited by 3 Feb 2008, 13:46

      skpdoc is a bridge to SDK world - it gives back the pointer to the Sketchup document interface. funny thing that it was available in SU5, removed in SU6 (least in 6.0.515 it was not available) and now is back 👊

      SketchUp Ruby Consultant | Podium 1.x developer
      http://plugins.ro

      1 Reply Last reply Reply Quote 0
      • T Offline
        TIG Moderator
        last edited by 3 Feb 2008, 21:17

        I think "get_product_family" is part of 'attribute' ruby stuff that you might have tried ?

        TIG

        1 Reply Last reply Reply Quote 0
        • T Offline
          todd burch
          last edited by 3 Feb 2008, 21:35

          I'll get the official word to see how Google wants to doc the API thing, and also the get_product_family as well.

          I'll report back when I hear back, or perhaps Google will post here. We'll see.

          Thanks, Todd

          1 Reply Last reply Reply Quote 0
          • T Offline
            todd burch
            last edited by 4 Feb 2008, 23:24

            The official word is they aren't to be documented, as they may go away at any time.

            Todd

            1 Reply Last reply Reply Quote 0
            • D Offline
              Dan Rathbun
              last edited by 30 Mar 2010, 07:44

              [API] Model.get_product_family
              http://code.google.com/apis/sketchup/docs/ourdoc/model.html#get_product_family

              Since this thread was last active (2008,) method .get_product_family has been documented in the API. I find it strange that this method is within the Model class, as it's a application attribute, and belongs within the Sketchup module (or an App subclass of module Sketchup.) I have posted this observation in the 7.x API thread.

              So the question(s) I have is:

              Is it ( Model.get_product_family ) really to be considered as deprecated ??

              And if so, should not the API doc (link above,) mention this ( and perhaps direct coders to use Sketchup.is_pro? instead ) ??

              I'm not here much anymore.

              1 Reply Last reply Reply Quote 0
              • S Offline
                scottlininger
                last edited by 30 Mar 2010, 15:55

                @dan rathbun said:

                Is it ( Model.get_product_family ) really to be considered as deprecated ??

                Dan,

                Now that the get_product_family method has been added to the API docs and our internal unit test suite, it is no longer at danger of being removed. In 2008 the thing existed, of course, but since it wasn't documented there was some doubt about its future.

                It's so cute and quirky, we've decided to keep it. 😉

                (I agree with you that it's attached to the wrong object, BTW. But once a method's in the wild it's really, really hard to change it.)

                Cheers,

                • Scott Lininger
                  SketchUp Software Engineer
                  Have you visited the Ruby API Docs?
                1 Reply Last reply Reply Quote 0
                • J Offline
                  jessejames
                  last edited by 30 Mar 2010, 16:44

                  @unknownuser said:

                  It's so cute and quirky, we've decided to keep it. 😉

                  (I agree with you that it's attached to the wrong object, BTW. But once a method's in the wild it's really, really hard to change it.)

                  Cheers,

                  Well this is going to sound condescending no matter how i put it so i'll dispense with any niceties and just be blunt, hope you all can handle it...?

                  It seems the API was written by people who have no experience using it. This is what happens when you get a bunch of low level C hackers who hardly use high-level scripting languages to spec out an API. I think it would behoove the dev team to gather input from the soldiers in the trenches instead of just barking orders from the White House.

                  Dan (along with Jim and others) has documented time and again the atrocities of the API and i have noticed many more. The fact is that we need to look towards a major release where all these blasphemies can be rectified into a beautiful API we can all love. Look i know mistakes are unavoidable and i am in no way saying i am better than anyone here. So lets put our collective heads together and make this API all it can be!

                  Are you with me?

                  Always sleep with a loaded gun under your pillow!

                  1 Reply Last reply Reply Quote 0
                  • 1 / 1
                  • First post
                    Last post
                  Buy SketchPlus
                  Buy SUbD
                  Buy WrapR
                  Buy eBook
                  Buy Modelur
                  Buy Vertex Tools
                  Buy SketchCuisine
                  Buy FormFonts

                  Advertisement