• Login
sketchucation logo sketchucation
  • Login
πŸ€‘ SketchPlus 1.3 | 44 Tools for $15 until June 20th Buy Now

SketchUp RUBY API Wishlist [way of coding wishes, please]

Scheduled Pinned Locked Moved Developers' Forum
107 Posts 46 Posters 39.8k 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.
  • J Offline
    Jackson
    last edited by 28 Oct 2008, 06:31

    Welcome to SCF Scott, it's great to see your involvement here!

    Jackson

    1 Reply Last reply Reply Quote 0
    • S Offline
      scottlininger
      last edited by 28 Oct 2008, 15:41

      @jim said:

      Something I have been wanting to do is write a suite of general-purpose Observers based on the built-in ones.

      This is a fantastic idea. Attaching observers reliably to every component instance, for example, is challenging. So a helper script is one approach... another would be to create some uber-observers at the Sketchup level. Obviously, there are potential performance concerns with any of these.

      • Scott Lininger
        SketchUp Software Engineer
        Have you visited the Ruby API Docs?
      1 Reply Last reply Reply Quote 0
      • J Offline
        JClements
        last edited by 29 Oct 2008, 10:48

        A standard for displaying script documentation, besides their description, in the menus:

        The ruby filename, creator, version level; basically an "about" display for each script. Optional info could be copyright info, contact (email) link, website link, and display of a help file on a local drive.

        =============================================

        An easier way to organize scripts in a user defined menu (there are scripts that do this now, but I wouldn't call them user friendly)

        John | Illustrator | Beaverton, Oregon

        1 Reply Last reply Reply Quote 0
        • T Offline
          tomasz
          last edited by 29 Oct 2008, 17:30

          New method for a texture, very useful for exporters.
          texture.alpha_channel? -> (true or false)

          Author of [Thea Render for SketchUp](http://www.thearender.com/sketchup)

          1 Reply Last reply Reply Quote 0
          • W Offline
            Whaat
            last edited by 29 Oct 2008, 18:19

            @unknownuser said:

            New method for a texture, very useful for exporters.
            texture.alpha_channel? -> (true or false)

            Ooohhh..that reminds me:

            How about a method that samples the texture color on a face?

            face.color_at(u,v)->returns a SketchUp::Color object.

            Could be used for displacement mapping inside SketchUp for example.

            SketchUp Plugins for Professionals

            1 Reply Last reply Reply Quote 0
            • J Offline
              Jim
              last edited by 29 Oct 2008, 20:19

              @david. said:

              Jim,

              Nice idea. Also, I'm curious if you mixed in the Singleton module to implement your singletons? I've found that I can't require a library module like Singleton unless I point directly to my Ruby installation directories. I realize that this isn't required to implement singletons, but it seems the most simple and consistent.

              Hi David,

              Yes, I used the singleton class from Ruby. I copied singleton.rb from the Ruby language installation to a 'ruby' folder in my Sketchup/Plugins folder. The Ruby singleton is very easy to use, and was simply the best and fastest solution. I think there are a few other files from the installed Ruby files that I needed also.

              Hi

              1 Reply Last reply Reply Quote 0
              • M Offline
                morisdov
                last edited by 30 Oct 2008, 15:44

                Hello

                Inside SketchUp it works fine but when creating an AVI file with Export -> Animation
                the - Sketchup::Pages.add_frame_change_observer - is not firing between frames.

                Is there anything i should change or another observer i can use between frames in Export Animation ?

                301 Moved Permanently

                favicon

                (www.sketchucation.com)

                Thanks

                1 Reply Last reply Reply Quote 0
                • J Offline
                  Jim
                  last edited by 2 Nov 2008, 13:19

                  One of the more important things that could be done using the Ruby API, and which would benefit nearly all users is a unified API for menus and toolbars. I don't mean being able to lock toolbars; I mean the possibility to provide menu and toolbar customization using a "Menu & Toolbar Editor" within SketchUp.

                  The need is apparent in CadFather's Toolbar plugins; where he creates a collection of scripts and adds toolbar buttons for them. Although these are nice toolbars, they are going to prove difficult to maintain as scripts are updated and obsoleted.

                  Really, there would need to be some registry that would:

                  • "install" a plugin so that is is not located in the Plugins folder, and so not automatically loaded.
                  • allow un-modified plugins to continue to function.
                  • allow new/modified plugins to create new, or be added to, existing menus, submenus, and toolbars.
                  • handle the creation of menus and toolbars at startup.

                  The possibilities are fantastic, if you let your mind run wild:

                  • allow menu/toolbars "sets" to be created.
                  • allow plugins to be downloaded as-needed, or used online. (zero install: net_require "progrsssbar.rb")
                  • check new versions of plugins online, and upgrade.

                  Of course, I do not mean to remove the ability for developers to create their own menu or toolbars. But even if it's just for the numerous scripts that are single-menu, or single-button plugins, this would be an improvement.

                  (related post)

                  Hi

                  1 Reply Last reply Reply Quote 0
                  • M Offline
                    Matt666
                    last edited by 3 Nov 2008, 14:38

                    Hi guys !
                    I wish one day, we would have access to print parameters via ruby... One day... πŸ˜„

                    Frenglish at its best !
                    My scripts

                    1 Reply Last reply Reply Quote 0
                    • T Offline
                      tomasz
                      last edited by 12 Nov 2008, 22:15

                      An important wish for ALL exporters, I believe:

                      • a method to read a cropped region in 2point perspective view.
                        As far as I am aware, currently there is no way to read it!

                      Please!

                      Author of [Thea Render for SketchUp](http://www.thearender.com/sketchup)

                      1 Reply Last reply Reply Quote 0
                      • T Offline
                        tomasz
                        last edited by 13 Nov 2008, 20:07

                        A Ruby method that will give us a real UVW coordinates of a projected texture, so exporters could use a single, original texture, instead of say 200 small textures of a photo mapped terrain.

                        Author of [Thea Render for SketchUp](http://www.thearender.com/sketchup)

                        1 Reply Last reply Reply Quote 0
                        • chrisglasierC Offline
                          chrisglasier
                          last edited by 23 Nov 2008, 03:30

                          A switch (if it does not exist) to activate a ruby on selection of an entity or entities to allow interaction with a webdialog.

                          See:
                          http://www.sketchucation.com/forums/scf/viewtopic.php?f=180&t=14299

                          Thanks

                          Chris

                          With TBA interfaces we can analyse what is to be achieved so that IT can help with automation to achieve it.

                          1 Reply Last reply Reply Quote 0
                          • TIGT Offline
                            TIG Moderator
                            last edited by 23 Nov 2008, 20:00

                            @chrisglasier said:

                            A switch (if it does not exist) to activate a ruby on selection of an entity or entities to allow interaction with a webdialog.

                            See:
                            http://www.sketchucation.com/forums/scf/viewtopic.php?f=180&t=14299

                            Thanks

                            Chris

                            Search v7..............

                            TIG

                            1 Reply Last reply Reply Quote 0
                            • N Offline
                              notareal
                              last edited by 26 Nov 2008, 12:55

                              @unknownuser said:

                              A Ruby method that will give us a real UVW coordinates of a projected texture, so exporters could use a single, original texture, instead of say 200 small textures of a photo mapped terrain.

                              πŸ‘ Agree!

                              Welcome to try [Thea Render](http://www.thearender.com/), Thea support | [kerkythea.net](http://www.kerkythea.net/) -team member

                              1 Reply Last reply Reply Quote 0
                              • C Offline
                                confitex architure
                                last edited by 1 Dec 2008, 13:34

                                Hi ScottLininger.
                                Not realy a ruby way of coding, but almost...
                                I mentionned it in an another post: It would be so nice to retrieve a variable from a model into a dynamic component's attribute instead of the opposit (right now, if I understand well, it is only possible to "export" and to make a code to fill the DC's attribute).

                                By the way, I would be very glad if we could learn from your famous animated "sprite" code πŸ˜„

                                Thanks!!!

                                1 Reply Last reply Reply Quote 0
                                • M Offline
                                  MarcioAB
                                  last edited by 16 Dec 2008, 10:42

                                  Access to Model.open ( open method of Model class ) as presented in this topic1 and this topic2.

                                  Thank you

                                  1 Reply Last reply Reply Quote 0
                                  • J Offline
                                    jessejames
                                    last edited by 10 Jan 2009, 02:32

                                    hello Scott,
                                    Thanks for your interest in helping out. That game you made was pretty cool.

                                    I would like to see some convience methods like in the Blender API. This may not be appealing to Gurus but might be quite helpful to the new rubyist. Something like...

                                    
                                    obj.LocX --> (0,0,0)
                                    obj.LocX += 20
                                    obj.LocX --> (20,0,0)
                                    obj.loc = 0,0,0 #set loc
                                    obj.getMatrix()
                                    
                                    

                                    i am also wondering why there is no way to do simple and dirty animations, like...

                                    
                                    Loop
                                        obj.LocX += 10
                                        sleep(.02)
                                        SU.Redraw()
                                    
                                    

                                    I really like most of the SU API's layout compared to Blender, except the Transformation module, it seems a little clumsy. But i might be missing something important. I am not an engineer, just a real brave lad, thats all.

                                    So if you want to enlighten me, feel free πŸ˜„

                                    Always sleep with a loaded gun under your pillow!

                                    1 Reply Last reply Reply Quote 0
                                    • daikuD Offline
                                      daiku
                                      last edited by 15 Jan 2009, 17:56

                                      I'd like to be able to specify the font size for text objects.

                                      Clark Bremer
                                      http://www.northernlightstimberframing.com

                                      1 Reply Last reply Reply Quote 0
                                      • T Offline
                                        tomot
                                        last edited by 16 Jan 2009, 22:22

                                        I would like to see a GUI added to the Ruby API. This has been sadly lacking from when the Ruby API was first added to be the scripting language for SU. Please add this to your SU8 wish list. Failing that, perhaps an easier task maybe to add a Python API with GUI to SU. I see no reason why SU can't function with 2 scripting languages.

                                        [my plugins](http://thingsvirtual.blogspot.ca/)
                                        tomot

                                        1 Reply Last reply Reply Quote 0
                                        • thomthomT Offline
                                          thomthom
                                          last edited by 17 Jan 2009, 11:06

                                          A GUI to the API what do you mean? As oppose to Webdialogs?

                                          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
                                          • 6
                                          • 2 / 6
                                          • First post
                                            Last post
                                          Buy SketchPlus
                                          Buy SUbD
                                          Buy WrapR
                                          Buy eBook
                                          Buy Modelur
                                          Buy Vertex Tools
                                          Buy SketchCuisine
                                          Buy FormFonts

                                          Advertisement