• Login
sketchucation logo sketchucation
  • Login
ℹ️ Licensed Extensions | FredoBatch, ElevationProfile, FredoSketch, LayOps, MatSim and Pic2Shape will require license from Sept 1st More Info

API Docs Comments

Scheduled Pinned Locked Moved Developers' Forum
40 Posts 8 Posters 4.8k Views 8 Watching
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.
  • C Offline
    Chris Fullmer
    last edited by 24 May 2010, 14:56

    Its great Jim! I've already done the entire constructionpoint class . 😄

    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 24 May 2010, 15:17

      @chris fullmer said:

      Its great Jim! I've already done the entire constructionpoint class . 😄

      @unknownuser said:

      point1 = Geom::Point3d.new (10,0,0)

      Spaces between method name and parentheses yields warnings:
      (eval):894: warning: don't put space before argument parentheses

      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 24 May 2010, 15:17

        Would be nice if the classes listed what class their inherit from.

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

        1 Reply Last reply Reply Quote 0
        • J Offline
          Jim
          last edited by 24 May 2010, 15:21

          @thomthom said:

          Would be nice if the classes listed what class their inherit from.

          Well fix it!

          Hi

          1 Reply Last reply Reply Quote 0
          • C Offline
            Chris Fullmer
            last edited by 24 May 2010, 15:48

            Eaxctly! 😄

            I copied that example from the API and I didn't notice the extra space there.

            Chris

            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 24 May 2010, 16:13

              I added Parent reference.

              And condensed the steps to create the sample CPoint in the example. (I don't see the need for all the small steps that the Google API has. At least not when they are just there to create sample objects to later demonstrate the method.)

              Also added a comment of the return value in the example. Something I have been missing in the Google API docs.

              Agree or disagree?

              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 24 May 2010, 16:15

                Jim, I just noticed the label system. You had labelled the classes inherited from Drawingelement. Nice system of organising.

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

                1 Reply Last reply Reply Quote 0
                • J Offline
                  Jim
                  last edited by 24 May 2010, 16:20

                  @thomthom said:

                  im, I just noticed the label system. You had labelled the classes inherited from Drawingelement. Nice system of organising.

                  Yeah, it worked out nicely. I can't say I planned it that way, though!

                  Hi

                  1 Reply Last reply Reply Quote 0
                  • T Offline
                    thomthom
                    last edited by 24 May 2010, 16:33

                    I think we can do the same for Entity, Tool, and Observers. Though observers are not inherent from an Observer class, could be nice to have them labelled like that?

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

                    1 Reply Last reply Reply Quote 0
                    • D Offline
                      Dan Rathbun
                      last edited by 24 May 2010, 17:45

                      @thomthom said:

                      ... Though observers are not inherent from an Observer class, could be nice to have them labelled like that?

                      One of my peeves with the SU API. There should be a Sketchup::Observer common class, which could have been a subclass of the Ruby base class Observer.

                      I'm not here much anymore.

                      1 Reply Last reply Reply Quote 0
                      • J Offline
                        Jim
                        last edited by 24 May 2010, 19:31

                        Is there a name for the classes that don't really exist other than to define an interface?

                        For example, there is no actual Tool base class in Sketchup. It's just a convention. An instance of any object can be a "Tool" if it responds_to certain instance_methods.

                        Hi

                        1 Reply Last reply Reply Quote 0
                        • D Offline
                          Dan Rathbun
                          last edited by 24 May 2010, 22:07

                          @dan rathbun said:

                          I called it a "protoclass" (but not sure I used the correct term.)

                          @unknownuser said:

                          (http://dictionary.reference.com/browse/proto )":2sb0s94w]proto- 
                          a combining form meaning “first,” “foremost,” “earliest form of,” used in the formation of compound words ...

                          I'm not here much anymore.

                          1 Reply Last reply Reply Quote 0
                          • D Offline
                            Dan Rathbun
                            last edited by 24 May 2010, 22:53

                            @jim said:

                            For example, there is no actual Tool base class in Sketchup. It's just a convention. An instance of any object can be a "Tool" if it responds_to certain instance_methods.

                            Reference, a topic at GoogleGroups:

                            @unknownuser said:

                            (http://groups.google.com/group/sketchupruby/tree/browse_frm/thread/6e6ead6cade3807a/440e3c753370ab23?rnum )":c5ik998j]
                            @unknownuser said:

                            (http://groups.google.com/group/sketchupruby/tree/browse_frm/thread/6e6ead6cade3807a/f1c8fdd8b6d98c72?rnum )":c5ik998j]2. I am sort of puzzed about what makes a tool. Is it the fact that it uses "Tool" methods?

                            Yes it is strange. There is not a Sketchup::Tool protoclass actually defined (but there could be, and might be argued, should be.)

                            So actually what makes a tool is that Sketchup treats an object as a tool if you call Sketchup.select_tool( object ); as up to that point Ruby and Skecthup would not know what it is supposed to be.

                            So then, SU assumes that it 'could' have any of the standard tool callback methods. I think .activate would be considered as a required method. While the tool is active, Sketchup sends information to the object by calling the method names defined in the API.

                            I called it a "protoclass" (but not sure I used the correct term.) IF there was a Sketchup::Tool class (and there really should be to be 'proper' OOP Ruby,) then it would called the superclass of the custom Tool subclass(es) that we write.

                            It would NOT be a baseclass, because they are defined at the toplevel, and generic to the entire Ruby world, not just Sketchup.

                            I'm not here much anymore.

                            1 Reply Last reply Reply Quote 0
                            • D Offline
                              Dan Rathbun
                              last edited by 24 May 2010, 22:54

                              So...

                              @jim said:

                              Is there a name for the classes that don't really exist other than to define an interface?

                              Would they then be called protoless classes ??

                              I'm not here much anymore.

                              1 Reply Last reply Reply Quote 0
                              • D Offline
                                Dan Rathbun
                                last edited by 24 May 2010, 23:22

                                @dan rathbun said:

                                So...

                                @jim said:

                                Is there a name for the classes that don't really exist other than to define an interface?

                                Would they then be called protoless classes ??

                                Looking through Dictionary.com (Thesaurus tab) for 'protoless' synonyms:

                                • Concocted
                                • Contrived
                                • Ad lib

                                Or perhaps:

                                • demiclass

                                I'm not here much anymore.

                                1 Reply Last reply Reply Quote 0
                                • J Offline
                                  Jim
                                  last edited by 25 May 2010, 13:43

                                  This is an html page of the SketchUp API classes. Save it as a .html file, and then bookmark it in Firefox. Edit the bookmark to open in the Sidebar. Instant API sidebar.

                                  Hi

                                  1 Reply Last reply Reply Quote 0
                                  • C Offline
                                    Chris Fullmer
                                    last edited by 25 May 2010, 15:33

                                    Jim, I think you forgot the link or something

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

                                    1 Reply Last reply Reply Quote 0
                                    • J Offline
                                      Jim
                                      last edited by 25 May 2010, 15:47

                                      Hmmm, first time that's ever happened...

                                      The forum doesn't like HTML, so I uploaded it encoded.

                                      • Open it in Notepad++,
                                      • Select all
                                      • Plugins > MIME Tools > Base64 decode
                                      • Save as api_sidebar.html

                                      (same way to decode those non-rbs encrypted scripts, btw.)


                                      api_sidebar.txt

                                      Hi

                                      1 Reply Last reply Reply Quote 0
                                      • D Offline
                                        Dan Rathbun
                                        last edited by 26 May 2010, 23:08

                                        ISSUE: the improper use of "Parent"

                                        Speaking specifically on: ConstructionPoint

                                        Familial terms: ie: parent and child are reserved for the instance object heirarchy, such the HTML Document Object Model, and in our case the Sketchup SKP document heirarchy.

                                        Example: the model object has children that can be Component, which can have children Groups, which may have children Edges and Faces, and so on.
                                        A Face instance inside a Group has THAT Group instance as it's Parent, but Group is NOT the superclass of Face.

                                        You will notice that in the SU API all .parent methods refer to the specific instance object's relationship within the document heirarchy.

                                        The correct terms are superclass, subclass, and class; all always LOWERCASE because Class (UPPERCASE,) is a specific class Identifier.

                                        I'm not here much anymore.

                                        1 Reply Last reply Reply Quote 0
                                        • J Offline
                                          Jim
                                          last edited by 27 May 2010, 01:51

                                          Thanks Dan,

                                          The ConstructionPoint page looks good.

                                          I am all for using the right terminology - i just don't know what that is all the time.

                                          How about ancestors and descendants?

                                          Hi

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

                                          Advertisement