sketchucation logo sketchucation
    • 登入
    Oops, your profile's looking a bit empty! To help us tailor your experience, please fill in key details like your SketchUp version, skill level, operating system, and more. Update and save your info on your profile page today!
    ⚠️ Important | Libfredo 15.6b introduces important bugfixes for Fredo's Extensions Update

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

    已排程 已置頂 已鎖定 已移動 Developers' Forum
    107 貼文 46 Posters 43.0k 瀏覽 46 Watching
    正在載入更多貼文
    • 從舊到新
    • 從新到舊
    • 最多點贊
    回覆
    • 在新貼文中回覆
    登入後回覆
    此主題已被刪除。只有擁有主題管理權限的使用者可以查看。
    • scottliningerS 離線
      scottlininger
      最後由 scottlininger 編輯

      Hey guys,

      My goal is to check these forums every day to see if I can be of help. I'm one of the "new guys" on the SketchUp team, having been with Google for about a year, now. In my day to day job I mostly work in the Ruby API, so I'm in the same boat as you in regards to its capabilities, and I'm an internal advocate for improvements.

      Maybe a moderator could split this into a new topic? I'd love to hear everyone's wish list.

      In any case, I will do some research into these posted bugs and confirm that they are in our internal tracking system.

      Cheers,

      • Scott Lininger
        SketchUp Software Engineer
        Have you visited the Ruby API Docs?
      1 條回覆 最後回覆 回覆 引用 0
      • M 離線
        MarcioAB
        最後由 編輯

        Great! A "Ruby API Wish List Followed by SketchUp Team". This could be a sticker, right ?

        The most up-to-date "Wish List" in the very first page and good discussions in the sub-sequent pages.

        Regards
        Marcio

        1 條回覆 最後回覆 回覆 引用 0
        • T 離線
          tomasz
          最後由 編輯

          Scott,
          I 've got one, almost a Christmas wish : - can Ruby tell me if I should use UVHelper instead of uv_at when I want to get proper UVs for a face, PLEASE!

          I other words - can Ruby tell me if the face's texture is photo-matched or not?
          Please check this thread. Could it be an additional .materialType result .. say 3?

          Tomasz

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

          1 條回覆 最後回覆 回覆 引用 0
          • J 離線
            Jim
            最後由 編輯

            Thanks for starting this topic, Scott!

            Ok, I split this topic off from the earlier posts and made it sticky. Let the wishing continue...

            Hi

            1 條回覆 最後回覆 回覆 引用 0
            • M 離線
              MarcioAB
              最後由 編輯

              Fix onMButtonDown() api.

              1 條回覆 最後回覆 回覆 引用 0
              • C 離線
                CPhillips
                最後由 編輯

                Here is one (of 1000):

                The text and dimension tool are not accessible from Ruby. You can't read or set the text for example.

                1 條回覆 最後回覆 回覆 引用 0
                • T 離線
                  tomasz
                  最後由 編輯

                  The Sections are hardly accessible from Ruby, only through Selection! You can't read or set it active.

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

                  1 條回覆 最後回覆 回覆 引用 0
                  • daikuD 離線
                    daiku
                    最後由 編輯

                    This is music to my ears, Scott. Here's another vote for ruby control of dimension objects. CB.

                    Clark Bremer
                    http://www.northernlightstimberframing.com

                    1 條回覆 最後回覆 回覆 引用 0
                    • T 離線
                      toxicvoxel
                      最後由 編輯

                      Two requests:
                      Simple methods for retrieving points,angles and distances without using a tool class.(Something as simple as 'getpoint' and getangle in AutoCAD's api. Maybe something like pt=Sketchup.utility.getpoint(prompt) for example)
                      'Getangle' should offer the use of the protractor tool for input.

                      Then a request for the Sketchup COM api: Include a 'runRubyScript' method that can be called from the api and returns the return value from the script.

                      1 條回覆 最後回覆 回覆 引用 0
                      • M 離線
                        Matt666
                        最後由 編輯

                        Hi all !
                        One great improvment would be to have some control on inferences via ruby... Isolate, stop, start, etc....

                        Frenglish at its best !
                        My scripts

                        1 條回覆 最後回覆 回覆 引用 0
                        • N 離線
                          NewOne
                          最後由 編輯

                          Move (and rotate) axes from ruby !!! Actually, to be able to access any tool from ruby.

                          regards!

                          1 條回覆 最後回覆 回覆 引用 0
                          • M 離線
                            Matt666
                            最後由 編輯

                            Hi all !
                            One ruby improvment :

                            • A command autolisp like function !! To have access to all native tools (like said NewOne), and to have possibility to control this tool !
                              Command autolisp function work like that :
                              To make a line :
                            (command "_LINE" "0,0,0" "10,0,0" "")
                            (command " 'International Name of the tool' " " 'first point' " " 'any point you want' " "")
                            

                            "" stops the command.
                            One very intersting thing is you can insert pause that let user doing what he wants !

                            (command "_LINE" "0,0,0" PAUSE" "")
                            

                            PAUSE stops process and let user giving a point, in this example.
                            Another cool thing is an Autocad variable that show if a command (or tool) is active. And you can use it in the code !

                            (command "_LINE")(while (not (eq (getvar "cmdactive") 0)))(command PAUSE))
                            

                            (getvar "cmdactive") returns 0 (no active tool) or 1 (one active tool)

                            Frenglish at its best !
                            My scripts

                            1 條回覆 最後回覆 回覆 引用 0
                            • T 離線
                              tomasz
                              最後由 編輯

                              Selection display bug to be fixed, please.

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

                              1 條回覆 最後回覆 回覆 引用 0
                              • J 離線
                                Jim
                                最後由 編輯

                                Something I have been wanting to do is write a suite of general-purpose Observers based on the built-in ones. Most of the Observers are designed to be attached to a specific entity in a model (or to THE model) - the SelectionObserver, for example is attached to a model's selection collection. It just seems inefficient and error-prone for each plugin author who needs one to implement their own SelectionObserver when a single instance can handle all requests.

                                So, I guess I'm really proposing a simplified API for using Observers.

                                The way I see this API working is that a plugin would 'require' the observer file, which would create a single Observer instance. Then the plugin would 'register' methods in the form of blocks (or procs?). In my experiments, I used the Ruby Singleton class to ensure there is ever only one instance created.

                                Here is how I see the API being used (without getting into the details of the implementation):

                                
                                # My Plugin
                                require 'app_observer' # Global AppObserver instance created
                                def hello(args)
                                  puts "Hello #{args}"
                                end
                                # Register hello() to be called for an onNewModel event
                                id = AppObserver.instance.register("onNewModel") {|args| hello(args) }
                                # AppObserver attaches itself when its registry goes from 0 to >0 elements
                                ...
                                AppObserver.instance.unregister(id) # stop calling hello for onNewModel event
                                # AppObserver detaches itself when its registry falls to 0 elements.
                                
                                

                                It really simplifies using Observers, which in turn could allow authors to create better plugins, with more advanced features, in a shorter time. It may also save on resources by having one and only one instance of most of the Observers (confirm?)

                                (related post)

                                Hi

                                1 條回覆 最後回覆 回覆 引用 0
                                • D 離線
                                  david.
                                  最後由 編輯

                                  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.

                                  1 條回覆 最後回覆 回覆 引用 0
                                  • J 離線
                                    Jackson
                                    最後由 編輯

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

                                    Jackson

                                    1 條回覆 最後回覆 回覆 引用 0
                                    • scottliningerS 離線
                                      scottlininger
                                      最後由 編輯

                                      @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 條回覆 最後回覆 回覆 引用 0
                                      • JClementsJ 離線
                                        JClements
                                        最後由 編輯

                                        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 條回覆 最後回覆 回覆 引用 0
                                        • T 離線
                                          tomasz
                                          最後由 編輯

                                          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 條回覆 最後回覆 回覆 引用 0
                                          • W 離線
                                            Whaat
                                            最後由 編輯

                                            @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 條回覆 最後回覆 回覆 引用 0
                                            • 1
                                            • 2
                                            • 3
                                            • 4
                                            • 5
                                            • 6
                                            • 5 / 6
                                            • 第一個貼文
                                              最後的貼文
                                            Buy SketchPlus
                                            Buy SUbD
                                            Buy WrapR
                                            Buy eBook
                                            Buy Modelur
                                            Buy Vertex Tools
                                            Buy SketchCuisine
                                            Buy FormFonts

                                            Advertisement