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

    New API doc - typos and questions

    Scheduled Pinned Locked Moved Developers' Forum
    370 Posts 35 Posters 256.4k Views 35 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.
    • thomthomT Offline
      thomthom
      last edited by

      http://code.google.com/intl/nb/apis/sketchup/docs/releases.html
      The release notes says:

      @unknownuser said:

      Cleaner, hash-based syntax for initializing

      But there's nowhere any example of what the hash should look like, keys etc.

      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

        Thom, you are right it needs to be documented.

        This is from the webtextures_loader.rb. The constants are defined a little earlier in the code, but this gives some idea about the keys:

        
         # Create our dialog.
            keys = {
              ;dialog_title => title,
              ;scrollable => false,
              ;preferences_key => WT_DIALOG_REGISTRY_KEY,
              ;height => WT_DIALOG_HEIGHT,
              ;width => WT_DIALOG_WIDTH,
              ;left => WT_DIALOG_X,
              ;top => WT_DIALOG_Y,
              ;resizable => true,
              ;mac_only_use_nswindow => true}
            @dialog = UI;;WebDialog.new(keys)
           
        

        Hi

        1 Reply Last reply Reply Quote 0
        • thomthomT Offline
          thomthom
          last edited by

          Thanks Jim. Would probably be able to guess most - but...

          What's unexpected there is :mac_only_use_nswindow - Same as WebDialog.navigation_buttons_enabled?

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

          1 Reply Last reply Reply Quote 0
          • Dan RathbunD Offline
            Dan Rathbun
            last edited by

            @thomthom said:

            What's unexpected there is :mac_only_use_nswindow - Same as WebDialog.navigation_buttons_enabled?

            Isn't 'nswindow' a base Cocoa (or Carbon) window class?

            I'm not here much anymore.

            1 Reply Last reply Reply Quote 0
            • thomthomT Offline
              thomthom
              last edited by

              @dan rathbun said:

              @thomthom said:

              What's unexpected there is :mac_only_use_nswindow - Same as WebDialog.navigation_buttons_enabled?

              Isn't 'nswindow' a base Cocoa (or Carbon) window class?

              hm... I Googled 'mac nswindow' seems that you might be onto something.
              http://developer.apple.com/mac/library/documentation/Cocoa/Reference/ApplicationKit/Classes/NSWindow_Class/Reference/Reference.html

              Does it give any visible difference when it's set to true as oppose to false?

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

              1 Reply Last reply Reply Quote 0
              • Dan RathbunD Offline
                Dan Rathbun
                last edited by

                @thomthom said:

                Does it give any visible difference when it's set to true as oppose to false?

                I don't know. I don't have an Apple machine. [..wish I could install OSX of my 686 clone for devlopment. XCode looks like a neat IDE.] There are so many attributes, methods, etc. there it's hard to guess what the SU API is refering to.

                I'm not here much anymore.

                1 Reply Last reply Reply Quote 0
                • thomthomT Offline
                  thomthom
                  last edited by

                  Edge.reversed_in?
                  http://code.google.com/intl/nb/apis/sketchup/docs/ourdoc/edge.html#reversed_in?
                  The reversed_in? method is used to determine if the EdgeUse object is traversed in the corresponding direction as its corresponding edge.

                  Apart from the EdgeUse typo - what does the method really do. I don't understand at all from the description what it does.

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

                  1 Reply Last reply Reply Quote 0
                  • TIGT Offline
                    TIG Moderator
                    last edited by

                    @thomthom said:

                    Edge.reversed_in?
                    http://code.google.com/intl/nb/apis/sketchup/docs/ourdoc/edge.html#reversed_in?
                    The reversed_in? method is used to determine if the EdgeUse object is traversed in the corresponding direction as its corresponding edge.

                    Apart from the EdgeUse typo - what does the method really do. I don't understand at all from the description what it does.

                    I use it in my 'orient faces' method - although I agree that it all seems pretty arcane and badly explained. If an edge is reversed in a face it is going contrary to that face's logical loop direction. If you test an edge belonging to a selected face and that edge has that face face plus another one that both return as being either reversed or not-reversed then you know that this other face has the same 'orientation' as the selected face: if the other face has the opposite 'reversed-ness' to the selected face then it needs to be flipped over (reversed) so it orients the same way as the selected face...

                    TIG

                    1 Reply Last reply Reply Quote 0
                    • thomthomT Offline
                      thomthom
                      last edited by

                      There's a logical orientation of the loops?

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

                      1 Reply Last reply Reply Quote 0
                      • TIGT Offline
                        TIG Moderator
                        last edited by

                        @thomthom said:

                        There's a logical orientation of the loops?

                        If you get a set of vertices for a face's loop it's always listed as an ordered array: it will be rotating 'counter-clockwise' to the face's normal if it's an external loop, or 'clockwise' if it's an internal loop... If an edge's start/end vertices break this 'rule' I think it's said to be 'reversed in the face' ? That is the order of the edge's vertices don't follow the loops 'handed-ness' so are flagged thus...

                        TIG

                        1 Reply Last reply Reply Quote 0
                        • J Offline
                          jarl
                          last edited by

                          @unknownuser said:

                          Your help in finding typos/missing details are very welcome!

                          On http://code.google.com/intl/da/apis/sketchup/docs/ourdoc/point3d.html#+ it says that the argument is a Point3d, but it should say a Vector3d.

                          Jarl

                          1 Reply Last reply Reply Quote 0
                          • thomthomT Offline
                            thomthom
                            last edited by

                            Geom;;Point3d.new(10,10,10) + Geom;;Point3d.new(20,20,20)
                            Error; #<ArgumentError; (eval);261;in `+'; Cannot convert argument to Sketchup;;Vector3d>
                            (eval);261
                            

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

                            1 Reply Last reply Reply Quote 0
                            • TIGT Offline
                              TIG Moderator
                              last edited by

                              @jarl said:

                              @unknownuser said:

                              Your help in finding typos/missing details are very welcome!

                              On http://code.google.com/intl/da/apis/sketchup/docs/ourdoc/point3d.html#+ it says that the argument is a Point3d, but it should say a Vector3d.

                              Jarl

                              If you add two pointstogether it returns a vector (or another point if it's taken as an array) ?

                              TIG

                              1 Reply Last reply Reply Quote 0
                              • thomthomT Offline
                                thomthom
                                last edited by

                                Color
                                http://code.google.com/intl/nb/apis/sketchup/docs/ourdoc/color.html

                                When creating a Color object you can specify an alpha value. Not mentioned in the examples.

                                Color.new
                                http://code.google.com/intl/nb/apis/sketchup/docs/ourdoc/color.html#new
                                The way the arguments are presented now it looks like they are all equal, but it's actually wither RGB(A) values or a String. It also takes Hex, array with Integers or Floats.

                                Oddly enough, you can do: Sketchup::Color.new(128) and get a Red-ish color. But not Sketchup::Color.new(128, 255) - where it will throw an error saying at least 3 values are required. So if you can specify 1, 3 or 4 values for the RGBA combination.

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

                                1 Reply Last reply Reply Quote 0
                                • TIGT Offline
                                  TIG Moderator
                                  last edited by

                                  But the Color's Alpha value is always ignored anyway ?
                                  Whereas Alpha value for the material is used !

                                  TIG

                                  1 Reply Last reply Reply Quote 0
                                  • thomthomT Offline
                                    thomthom
                                    last edited by

                                    @tig said:

                                    But the Color's Alpha value is always ignored anyway ?
                                    Whereas Alpha value for the material is used !

                                    Yea, that's what I've noticed as well. Confusing. Should be mentioned in the docs. I had hoped that the alpha channel would be used the the view.draw2d method, but alas - it does not. Wondering if it's by design or if it's a bug.

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

                                    1 Reply Last reply Reply Quote 0
                                    • TIGT Offline
                                      TIG Moderator
                                      last edited by

                                      I guess it was perhaps an early implementation when perhaps Color and Material were the same thing ?
                                      Also I suppose it allows you to import a RGBA value from elsewhere directly into a Color, but then using the first 3 items in the array is no hardship ???
                                      Seems that the alpha could be removed as it's not needed/useful ?

                                      TIG

                                      1 Reply Last reply Reply Quote 0
                                      • thomthomT Offline
                                        thomthom
                                        last edited by

                                        I'd rather see view.drawingcolor= make use of the alpha channel and let us draw transparent objects to the viewport.

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

                                        1 Reply Last reply Reply Quote 0
                                        • thomthomT Offline
                                          thomthom
                                          last edited by

                                          @tig said:

                                          That would be much more use... unfortunately with drawaren't we limited to the built-in color-set, and that has no transparency setting ?

                                          draw is currently bugged an only draws black fill.
                                          draw2d works, and you can specify any Color object (or hex,int,float,array that equal to a colour) but it ignores the alpha.

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

                                          1 Reply Last reply Reply Quote 0
                                          • TIGT Offline
                                            TIG Moderator
                                            last edited by

                                            @thomthom said:

                                            I'd rather see view.drawingcolor= make use of the alpha channel and let us draw transparent objects to the viewport.

                                            That would be much more use... unfortunately with draw aren't we limited to the built-in color-set, and that has no transparency setting ?
                                            Transparency ispossible with OpenGL but not as I can seem in it's port to Ruby and SUp ???

                                            TIG

                                            1 Reply Last reply Reply Quote 0
                                            • 1
                                            • 2
                                            • 8
                                            • 9
                                            • 10
                                            • 11
                                            • 12
                                            • 18
                                            • 19
                                            • 10 / 19
                                            • First post
                                              Last post
                                            Buy SketchPlus
                                            Buy SUbD
                                            Buy WrapR
                                            Buy eBook
                                            Buy Modelur
                                            Buy Vertex Tools
                                            Buy SketchCuisine
                                            Buy FormFonts

                                            Advertisement