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.
    • Dan RathbunD Offline
      Dan Rathbun
      last edited by

      @dan rathbun said:

      (An alternative... we might create tb_Name constantsunder the UI module that would be the same for both platforms.)

      Here's an example, call it 'UI_tb_const.rb'

      module UI
      
      #
      # Example ONLY
      #
      
      case Sketchup;;OS
      when ;WIN
      	#
        tb_CAM = 'Camera'.freeze
        tb_CONS = 'Construction'.freeze
        tb_DISP = 'DisplayMode'.freeze
        tb_DRAW = 'Drawing'.freeze
        tb_EDIT = 'Edit'.freeze
        tb_GETS = 'GettingStarted'.freeze
        tb_GOOG = 'Google'.freeze
        tb_LTS = 'LargeToolSet'.freeze
        tb_LAYR = 'Layers'.freeze
        tb_STD = 'Standard'.freeze
        tb_TABS = 'SceneTabs'.freeze
        tb_PRIN = 'Principle'.freeze # spelling!
        tb_SBAR = 'StatusBar'.freeze
        tb_SECT = 'Section'.freeze
        tb_SHAD = 'Shadows'.freeze
        tb_VIEW = 'StandardViews'.freeze
        tb_VCB = 'VCB'.freeze
        tb_WALK = 'Walk'.freeze
      	#
      when ;OSX
      	#     what are the Mac Strings?
        tb_CAM = 'Camera'.freeze
        tb_CONS = 'Construction'.freeze
        tb_DISP = 'DisplayMode'.freeze
        tb_DRAW = 'Drawing'.freeze
        tb_EDIT = 'Edit'.freeze
        tb_GETS = 'GettingStarted'.freeze
        tb_GOOG = 'Google'.freeze
        tb_LTS = 'LargeToolSet'.freeze
        tb_LAYR = 'Layers'.freeze
        tb_STD = 'Standard'.freeze
        tb_TABS = 'SceneTabs'.freeze
        tb_PRIN = 'Principle'.freeze # spelling!
        tb_SBAR = 'StatusBar'.freeze
        tb_SECT = 'Section'.freeze
        tb_SHAD = 'Shadows'.freeze
        tb_VIEW = 'StandardViews'.freeze
        tb_VCB = 'VCB'.freeze
        tb_WALK = 'Walk'.freeze
      	#
      end # case
      
      end # module UI extension
      

      I'm not here much anymore.

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

        UI.toolbar_names
        http://code.google.com/apis/sketchup/docs/ourdoc/ui.html#toolbar_names

        @unknownuser said:

        The toolbar_names method is used to returns the name of all the available toolbars (this differs between PC and Mac).

        (1) In the above sentence "returns" should be singular.

        (2) I believe punctuation marks are supposed to go at the end of the words, ie: "Mac.)" not "Mac)." ...Language majors, confirm?

        (3) It would nice if we are to do cross-platform scripts, that you list the names for PC and Mac in the API.

        (4) UI.toolbar_names.sort on the PC, ver 7.1 returns:

        ["Camera", "Construction", "DisplayMode", "Drawing", "Edit", "GettingStarted", "Google", "Principle", "Section", "Standard", "StandardViews", "VCB", "Walk"]
        .
        On the [Win32] Sketchup Menu: View > Toolbars(and toolbar captions):

        • Principle is Principal* Edit is Modification* VCB is Measurements* StandardViews is Views* Section is Sections* DisplayMode is FaceStyle* Walk is Walkthrough
          These are on the [Win32] Menu: View > Toolbars but, missing from the UI toolbar methods:

        • LargeToolSet* Layers* SceneTabs (on View menu )* Shadows
          Missing from View Menu and toolbar methods:

        • StatusBar
          (We can toggle it on/off [with send_action on PC], so might as well add it to the toolbar methods so we can test it's visiblilty, and use set_toolbar_visible for cross platform [if it can be toggled on MAC.])* If a user has the StatusBar off, a tool might want to instead display a messagebox if it must inform the user of some fact, so it needs to test whether it's on/off.

        (5) This same Toolbar Name Identifier Set is used with the following methods, and have the same problems, missing Identifiers, etc.

        • UI.set_toolbar_visible* UI.toolbar_visible?

        So.. we don't mind variation in the toolbar names/symbols, so long as we know what that variation is.

        (An alternative... we might create tb_Name constants under the UI module that would be the same for both platforms.)

        I'm not here much anymore.

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

          Entities.add_curve
          http://code.google.com/apis/sketchup/docs/ourdoc/entities.html#add_curve

          @unknownuser said:

          Returns:
          curve a Curve object if successful

          SU7.1M1 PC returns an array of edges. Other versions untested. I'm submitting this as 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
          • thomthomT Offline
            thomthom
            last edited by

            Curve.move_vertices
            http://code.google.com/apis/sketchup/docs/ourdoc/curve.html#move_vertices

            @unknownuser said:

            The vertices method retrieves a collection of all vertices in a curve.

            Seem to have copied the text from Curve.vertices.
            Description needs updating along with an example.

            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:

              Entities.add_curve
              http://code.google.com/apis/sketchup/docs/ourdoc/entities.html#add_curve

              @unknownuser said:

              Returns:
              curve a Curve object if successful

              SU7.1M1 PC returns an array of edges. Other versions untested. I'm submitting this as a bug.

              It's always returned an array of edges - the curve is then array[0].curve

              TIG

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

                _
                Model.title

                @unknownuser said:

                The tile method retrieves the name of the model. If the model is saved on disk, returns the file name without extension. Otherwise returns an empty string.
                http://code.google.com/apis/sketchup/docs/ourdoc/model.html#title
                Change 'tile' to 'title' in method description.

                We could use Model.is_saved? and Model.is_unsaved? methods, as the Model.title method is the only way (that I can find) to determine if the model has yet been saved or not. We cannot rely upon the word 'Untitled' (in the caption bar) because that may actually be a valid filename.

                Workaround:

                
                class Sketchup;;Model
                def is_saved?
                  return not title.empty?
                end
                def is_unsaved?
                  return title.empty?
                end
                end # class
                
                

                _

                I'm not here much anymore.

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

                  Camera.set
                  http://code.google.com/intl/nb/apis/sketchup/docs/ourdoc/camera.html#set

                  
                  The initialize method is deprecated. It essentially does the same thing as Camera.set.
                  
                  

                  Seems that's the description for Camera.new http://code.google.com/intl/nb/apis/sketchup/docs/ourdoc/camera.html#new
                  ...and that Camera.new has the description for Camera.set

                  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

                    View.pickray
                    http://code.google.com/apis/sketchup/docs/ourdoc/view.html#pickray

                    @unknownuser said:

                    Returns:
                    ray
                    a ray

                    "a ray"? Without testing this I#m guessing either a vector or line.

                    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:

                      View.pickray
                      http://code.google.com/apis/sketchup/docs/ourdoc/view.html#pickray

                      @unknownuser said:

                      Returns:
                      ray a ray

                      "a ray"? Without testing this I#m guessing either a vector or line.

                      see this...

                      @unknownuser said:

                      Model.raytest
                      A ray is a two element array containing a point and a vector [Geom::Point3d(), Geom::Vector3d()]. http://code.google.com/apis/sketchup/docs/ourdoc/model.html#raytest
                      _

                      I'm not here much anymore.

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

                        Yea - I tested it later that day. It's what the Geom module describes as a line.

                        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:

                          Yea - I tested it later that day. It's what the Geom module describes as a line.

                          Shouldn't the API have a definition for Line and/or Ray as a class (under the Geom module) ?

                          something like:

                          
                          class Geom;;Ray < Array
                            def new(*args)
                              Array[Geom;;Point3d().new, Geom;;Vector3d().new]
                              super()
                            end
                          end
                          
                          

                          I'm not here much anymore.

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

                            Line and Plane? hm... maybe... thought of that myself. but never really felt the need for it to make a request. works fine as it is.

                            Dealing with them as Arrays works ok. They are simple structures.

                            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

                              Model.add_note

                              The note is not displayed unless there are entities in the model. If you add a note first thing in a new model, it is invisible but .visible? on the note object still returns true.

                              As soon as you draw something, the note appears.

                              I'm not here much anymore.

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

                                Thanks Dan - yet more never-seen-before docs coming to light.

                                Hi

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

                                  I have the mental image of Scott drowning in printouts from this thread... 😒 😆

                                  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

                                    Oh, I think there is a completely undocumented UTM class in there somewhere under Geom.

                                    Hi

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

                                      @jim said:

                                      Oh, I think there is a completely undocumented UTM class in there somewhere under Geom.

                                      hm.. all I can find out about that one is:
                                      Geom::UTM.instance_methods.sort.join("\n") (eval):894: warning: instance_methods: parameter will default to 'true' as of 1.8.1 to_a to_latlong to_s x y zone_letter zone_number

                                      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

                                        View.show_frame

                                        Documentation for this method contains some poorly-parsed html tags.

                                        Hi

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

                                          @thomthom said:

                                          @jim said:

                                          Oh, I think there is a completely undocumented UTM class in there somewhere under Geom.

                                          hm.. all I can find out about that one is:
                                          Geom::UTM.instance_methods.sort.join("\n")... snip ...

                                          from Wikipedia search on "UTM":
                                          Universal Transverse Mercator coordinate system, a grid-based method of mapping locations on the surface of the Earth.
                                          http://en.wikipedia.org/wiki/Universal_Transverse_Mercator_coordinate_system
                                          _

                                          I'm not here much anymore.

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

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

                                            @unknownuser said:

                                            Returns a constant number which indicates the product family of the installed SketchUp application.

                                            This is an Application related attribute, why is it part of the Model class?

                                            This should be a method of the Sketchup module as in: Sketchup.get_product_family
                                            _

                                            I'm not here much anymore.

                                            1 Reply Last reply Reply Quote 0
                                            • 1
                                            • 2
                                            • 15
                                            • 16
                                            • 17
                                            • 18
                                            • 19
                                            • 19 / 19
                                            • First post
                                              Last post
                                            Buy SketchPlus
                                            Buy SUbD
                                            Buy WrapR
                                            Buy eBook
                                            Buy Modelur
                                            Buy Vertex Tools
                                            Buy SketchCuisine
                                            Buy FormFonts

                                            Advertisement