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

      @wood_galaxy

      Now I understand you. 😒
      It is indeed a typo in that example code and it should be "'" NOT ''' - the first two '' are taken as an empty string and the third one as a start of a new string - so it's not really a 'rem' - a # or =begin...=end does that in Ruby - it's simply made all of the following code into a string until it reaches the next ' which happens to be inside a comment "can**'**t", thereafter the code resumes again, but of course at that point it's garbled and will return errors and not work...
      This type of error is sometimes hard to find but if you are using Notepad++ it'd be obvious, as the syntax highlighting would should a massive block of 'string' text where it shouldn't be, so looking at it's start/end delimiters ['] tells us what's up and what needs fixing...
      See the original and the correction [the rest of the code - with the exception of the unnecessary $ variable in the menu setup seems OK]Capture.PNGCapture1.PNG
      I thought you were using some of it for your own ends and having problems...
      There are MANY errors in the API examples - it's been discussed, and indeed the main API docs used to have a user comments section at the end of each page where we pointed out the mistakes.
      When Google moved the content these were 'lost'.
      SketchUp still have the text but it's the way of including it that is lacking.
      Various ways of introducing a 'wiki-like' system have been mooted, but nothing to date...

      TIG

      1 條回覆 最後回覆 回覆 引用 0
      • H 離線
        honkinberry
        最後由 編輯

        I finally tracked down a bug that popped up with 7.1, but not sure if this is the best place to note it.

        But for Transformation.scaling, both (scale) and (pt, scale) have a bug.
        One instead needs to use (xscale, yscale, zscale), even though all 3 parameters will be the same.

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

          Yea, that's a nasty one. It used to be in the comments of the API docs, but it disappeared some time ago.

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

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

            Is anyone else having a hard time accessing the Sketchup Ruby API today?

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

              Yeah, the URLs got messed up when they launched the new site. Hope the fix the forwarding soon. You find working links at the bottom of sketchup.com

              Sent from my LT25i using Tapatalk 2

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

              1 條回覆 最後回覆 回覆 引用 0
              • A 離線
                Aerilius
                最後由 編輯

                For now, you can add ".php" in the address bar.

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

                  index.jpg

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

                  1 條回覆 最後回覆 回覆 引用 0
                  • X 離線
                    XorUnison
                    最後由 編輯

                    I would assume typos can still be posted here? If so, here's one:
                    http://www.sketchup.com/intl/en/developer/docs/ourdoc/tool#onKeyDown

                    Tool.onKeyDown SketchUp 6.0+

                    The onKeyDown method is called by SketchUp when the user presses a key on the keyboard. If you want to get input from the VCB, you should implement onUserText rather than this method.

                    This method is can be used for special keys such as the Shift key

                    1 條回覆 最後回覆 回覆 引用 0
                    • TommyKT 離線
                      TommyK
                      最後由 編輯

                      Model Observer:
                      onAfterComponentSaveAs(model)
                      and
                      onBeforeComponentSaveAs(model)

                      The "model" parameter is actually a ComponentInstance object - the one currently selected. This is the case at least in Sketchup 2015.

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

                        Yeah! really great information about documentation about API .
                        Thank You so much i will be helpful for me

                        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