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

    New API doc - typos and questions

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

      @thomthom said:

      ModelObserver.onPlaceComponent
      http://code.google.com/apis/sketchup/docs/ourdoc/modelobserver.html#onPlaceComponent

      The manual claims that a Model is passed on as the argument, but instead it's the ComponentInstance. I have not tested the rest of the ModelObserver events to see if they also match.

      Thomas, you rock.

      I'll double check all of the modelobserver arguments. Thanks!

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

        For Point3d.distance_to_line the docs give the same example as point3d.distance.

        http://remusrendering.wordpress.com/

        1 條回覆 最後回覆 回覆 引用 0
        • thomthomT 離線
          thomthom
          最後由 編輯

          I can't get the DefinitionObserver to trigger at all. http://code.google.com/apis/sketchup/docs/ourdoc/definitionobserver.html Neither the onComponentInstanceAdded or onComponentInstanceRemoved events. Are these the correct event names?

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

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

            I just had a big one reported to me... posting it here so folks are aware until the next fix.

            The face.material method is entirely missing from the new docs.

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

              There's a new update live that fixes (most of) the problems reported above. There were one or two that will require me to pound on it a bit more. Keep 'em coming!

              I also posted a new tutorial on reading attributes.

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

                Nice one Scott.

                I seem to have come across three observer events that doesn't work. It would probably be useful to mark these in the docs with a warning so that people won't waste a whole lot of time trying to get them work work. ..like I have...

                DefinitionObserver http://www.sketchucation.com/forums/scf/viewtopic.php?f=180&t=17631 (Completely busted)
                EntitiesObserver.onContentsModified http://www.sketchucation.com/forums/scf/viewtopic.php?f=180&t=17970 (Add and Remove event works though. Haven't tried the Erase event.)

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

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

                  I also just got this one from a coworker:

                  Sketchup.get_resource_path example fails. Looks like there's a required parameter that's not properly documented.

                  -Scott

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

                    These failing observers is quite severe. I don't suppose there's a chance the dev team can push out an update outside the servicepack schedule? (I don't know what your schedule is, but seeing that we just got an servicepack I'm a bit pessimistic to when this might be addressed...)

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

                    1 條回覆 最後回覆 回覆 引用 0
                    • R 離線
                      remus
                      最後由 編輯

                      A semi related typo:

                      in this tutorial pt4=[0,9,9] whereas it should be [0,9,0].

                      http://remusrendering.wordpress.com/

                      1 條回覆 最後回覆 回覆 引用 0
                      • Chris FullmerC 離線
                        Chris Fullmer
                        最後由 編輯

                        ::OFF TOPIC::
                        All right Remus, come clean. Your always in the Ruby forum, you spotted a typo in tutorial, you answer questions once in a while....how much ruby do you know? Are you making plugins and selling them overseas for big money or something?

                        Chris

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

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

                          Just saw another one: the Sketchup.break_edges= example is the Sketchup.break_edges? example.

                          Thom, step 1 with the observers is to confirm if it's the implementation that is broken or the documentation. Simone has filed A-list bugs against the observer problems you've found, and he and I have been chatting about it. Any fixes will have to wait until the next maintenance release.

                          Feel free to PM me if you want to brainstorm workarounds for what you're trying to accomplish. I know a few tricks. 😉

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

                            Dont pretend your not in on it as well 😄

                            on a more serious note, it seems a shame to miss out on the ever so powerful ruby based capabilities of sketchup, so i thought i'd try my hand at it and see if i got anywhere.

                            I reckon i could just about right a box making script at the moment 👍 just as long as you dont want to change your box at all...

                            http://remusrendering.wordpress.com/

                            1 條回覆 最後回覆 回覆 引用 0
                            • thomthomT 離線
                              thomthom
                              最後由 編輯

                              Seems that InstanceObserver.onClose is dead as well. http://code.google.com/apis/sketchup/docs/ourdoc/instanceobserver.html#onClose
                              But onOpen works.

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

                              1 條回覆 最後回覆 回覆 引用 0
                              • thomthomT 離線
                                thomthom
                                最後由 編輯

                                Error 404 (Not Found)!!1

                                favicon

                                (code.google.com)

                                @unknownuser said:

                                For example, if a user has double-clicked into a component to edit its geometry, and then double clicked into a sub-group to edit that, the active_path might contain:

                                And there it stops. Doesn't actually display an example.

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

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

                                  Self note: We should add these codes to the send_action docs:

                                  http://groups.google.com/group/Ruby-API/msg/e30ee3f2b21cb228

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

                                    http://code.google.com/apis/sketchup/docs/ourdoc/toolsobserver.html

                                    
                                         # This is an example of an observer that watches tool interactions.
                                         class MyToolsObserver < Sketchup;;ShadowInfoObserver
                                           def onActiveToolChanged(tools, tool_name, tool_id)
                                             UI.messagebox("onActiveToolChanged; " + tool_name.to_s)
                                           end
                                         end
                                    
                                         # Attach the observer.
                                         Sketchup.active_model.tools.add_observer(MyToolsObserver.new)
                                    
                                    

                                    Note that it refers to Sketchup::ShadowInfoObserver instead of Sketchup::ToolsObserver.

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

                                    1 條回覆 最後回覆 回覆 引用 0
                                    • TIGT 離線
                                      TIG Moderator
                                      最後由 編輯

                                      @unknownuser said:

                                      Self note: We should add these codes to the send_action docs:

                                      http://groups.google.com/group/Ruby-API/msg/e30ee3f2b21cb228

                                      Does this list work 'across-platforms' - my understanding was that PCs and Macs differ ?

                                      If there are such codes it makes like a lot easier...

                                      Some "wrong": Sketchup.send_action 21513 >>> opens the Outliner ???
                                      .

                                      TIG

                                      1 條回覆 最後回覆 回覆 引用 0
                                      • thomthomT 離線
                                        thomthom
                                        最後由 編輯

                                        Error 404 (Not Found)!!1

                                        favicon

                                        (code.google.com)

                                        The manual says the argument should be either true or false, but the example sets it to 3.

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

                                        1 條回覆 最後回覆 回覆 引用 0
                                        • Chris FullmerC 離線
                                          Chris Fullmer
                                          最後由 編輯

                                          The FAQ page lists some sites that carry/catalog ruby scripts. the Sketchucation extensions index (thanks to Jim!) would also be a great resource to add to that list now

                                          extensions url:

                                          410 Gone

                                          favicon

                                          (www.sketchucation.com)

                                          Chris

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

                                          1 條回覆 最後回覆 回覆 引用 0
                                          • thomthomT 離線
                                            thomthom
                                            最後由 編輯

                                            http://code.google.com/apis/sketchup/docs/ourdoc/toolsobserver.html
                                            It'd be nice if the ToolsObserver listed the full list of tools IDs.

                                            I've begun a list here which associates constants to the IDs for convenient use in scripts: http://www.sketchucation.com/forums/scf/viewtopic.php?f=180&t=18124

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

                                            1 條回覆 最後回覆 回覆 引用 0
                                            • 1
                                            • 2
                                            • 10
                                            • 11
                                            • 12
                                            • 13
                                            • 14
                                            • 18
                                            • 19
                                            • 12 / 19
                                            • 第一個貼文
                                              最後的貼文
                                            Buy SketchPlus
                                            Buy SUbD
                                            Buy WrapR
                                            Buy eBook
                                            Buy Modelur
                                            Buy Vertex Tools
                                            Buy SketchCuisine
                                            Buy FormFonts

                                            Advertisement