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
    正在載入更多貼文
    • 從舊到新
    • 從新到舊
    • 最多點贊
    回覆
    • 在新貼文中回覆
    登入後回覆
    此主題已被刪除。只有擁有主題管理權限的使用者可以查看。
    • thomthomT 離線
      thomthom
      最後由 編輯

      @unknownuser said:

      I'm about to push an update with all of the recent changes above. This one puzzled me, though. The ToolsObserver examples work fine for me on the onOpen and onClose. Can you clarify what "dead as well" means? 😄

      Dead as in: I never see it trigger.

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

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

        ToolObservers? How are they related to onClose and onOpen?

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

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

          @unknownuser said:

          Jim, is there a way that I could be granted edit rights just to this thread? Then I could add a FIXED note inside the reports as I correct them?

          I'll ask gai if he can make you a mod for the ruby forum 👍

          http://remusrendering.wordpress.com/

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

            @thomthom said:

            ToolObservers? How are they related to onClose and onOpen?

            I meant to say, InstanceObservers. 😛

            In any case, they fire fine for me.

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

              @remus said:

              @unknownuser said:

              Jim, is there a way that I could be granted edit rights just to this thread? Then I could add a FIXED note inside the reports as I correct them?

              I'll ask gai if he can make you a mod for the ruby forum 👍

              Scott, there's no way to give edit-rights on a single topic. So you get edit rights to the whole Ruby Forum.

              If you have a list of changes, we can take care of marking them fixed. I'd hate to see you spend time doing it if you have more important work to do.

              Hi

              1 條回覆 最後回覆 回覆 引用 0
              • GaieusG 離線
                Gaieus
                最後由 編輯

                Hi Scott, I have sent you a PM, too, about it. The mods have also be informed to welcome you in the team.
                😆

                Gai...

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

                  @unknownuser said:

                  @thomthom said:

                  ToolObservers? How are they related to onClose and onOpen?

                  I meant to say, InstanceObservers. 😛

                  In any case, they fire fine for me.

                  Hmm... When I tried to implement it in my plugin the onClose never fired. I also tried Jim's observer test script: http://sketchuptips.blogspot.com/2008/03/plugin-oberver-tests.html - and that never fired either. Could you post a working sample where onClose fires? (The onOpen always works though.)

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

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

                    @thomthom said:

                    Could you post a working sample where onClose fires?

                    Give this a go... Could be that we're seeing a sneaky bug...

                    class MyInstanceObserver < Sketchup;;InstanceObserver
                       def onOpen(instance)
                         UI.messagebox("onOpen; " + instance.to_s)
                       end
                    
                       def onClose(instance)
                         UI.messagebox("onClose; " + instance.to_s)
                       end
                    end
                    
                    model = Sketchup.active_model
                    model.definitions[0].instances[0].add_observer(MyInstanceObserver.new)
                    
                    • Scott Lininger
                      SketchUp Software Engineer
                      Have you visited the Ruby API Docs?
                    1 條回覆 最後回覆 回覆 引用 0
                    • thomthomT 離線
                      thomthom
                      最後由 編輯

                      Nopes. Doesn't work.

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

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

                        Works for me...

                        Hi

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

                          Scott just found out that it works if the script loads when SU loads. But if you put it a subfolder for instance, and then manually load it, it won't work.
                          Jim's Observer tests never fire the event in SU7. However, in SU6 it works fine.

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

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

                            Just wondering if you have Dynamic Components on, and what happens if you turn them off?

                            Hi

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

                              @jim said:

                              Just wondering if you have Dynamic Components on, and what happens if you turn them off?

                              Well I'll be! After disabling DCs the onClose even works!

                              btw, the DefinitionObserver works in SU6. But not SU7. Noticed that when I tested this observer in SU6.

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

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

                                Self note: need to add an explanation of how add_face works in relation to which "side" of the face is inside vs. outside, and document the exception where faces drawn at z=0 are always drawn with inside facing upward.

                                😄

                                -Scott Lininger

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

                                  From Didier's post:

                                  301 Moved Permanently

                                  favicon

                                  (www.sketchucation.com)

                                  Need to add an FAQ for getting to installation directory of SU, for folks trying to build installers (and find out a mac equivalent.)

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

                                    BoundingBox.valid?

                                    text says

                                    status
                                        true if the bounding box is valid (not empty), false if it is not valid (empty)
                                    

                                    but the code example has it exactly the opposite:

                                     bbox = Sketchup.active_model.bounds
                                     status = bbox.valid?
                                     if (status)
                                       # If true, bounding box is empty.
                                     else
                                       # If false, bounding box contains entities.
                                     end
                                    
                                    1 條回覆 最後回覆 回覆 引用 0
                                    • Chris FullmerC 離線
                                      Chris Fullmer
                                      最後由 編輯

                                      The introduction to RenderingOptions class states:

                                      @unknownuser said:

                                      The majority of the rendering information returned exists in the Model Info > Display section of SketchUp.

                                      There is no longer a Model Info > Distplay section of SketchUp. I suppose it should say its in the styles inspector or something like that.

                                      http://code.google.com/apis/sketchup/docs/ourdoc/renderingoptions.html#introduction

                                      Also, the API doesn't list these:

                                      DisplayQueWidth
                                      DisplayDims
                                      DisplaySketchAxes
                                      DisplayText
                                      DisplayWatermarks
                                      DrawDepthQue
                                      DrawLineEnds
                                      DrawProfilesOnly
                                      DrawUnderground
                                      EdgeType
                                      FogEndDist*- listed as FogEnd in the API*
                                      FogStartDist - listed as FogStart in the API
                                      HideConstructionGeometry
                                      LineEndWidth
                                      LockedColor
                                      SectionTransparencyMode
                                      ShowViewName

                                      And the API lists these which don't appear to be valid:
                                      DisplayFogEdges
                                      FogDensity
                                      FogEnd - appears to actually be FogEndDist
                                      FogStart*- appears to actually be FogStartDist*
                                      FogType

                                      I tried to be thorough, but perhaps I missed something. It might not be bad to double check my work 😄

                                      Chris

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

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

                                        http://code.google.com/apis/sketchup/docs/ourdoc/tool.html#onReturn

                                        the onReturn method is showing an example for onMouseLeave

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

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

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

                                          Does not give an example of view.zoom_extents. It gives an example of view.zoom

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

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

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

                                            @unknownuser said:

                                            The onExplode method is invoked whenever a component anywhere in this model is exploded. This is an easier way to watch explode events vs. attaching an InstanceObserver to every instance in the model.

                                            The docs in InstanceObserver http://code.google.com/apis/sketchup/docs/ourdoc/instanceobserver.html doesn't mention any explode event. All though, I imagine there used to be. ModelObserver.onExplode is new to SU7, and I'm sure there was an explode related event in SU6. But it's MIA atm.

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

                                            1 條回覆 最後回覆 回覆 引用 0
                                            • 1
                                            • 2
                                            • 15
                                            • 16
                                            • 17
                                            • 18
                                            • 19
                                            • 19 / 19
                                            • 第一個貼文
                                              最後的貼文
                                            Buy SketchPlus
                                            Buy SUbD
                                            Buy WrapR
                                            Buy eBook
                                            Buy Modelur
                                            Buy Vertex Tools
                                            Buy SketchCuisine
                                            Buy FormFonts

                                            Advertisement