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

    [Plugin] Plugins help script

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

      As AdamB suggested, here is a script for quickly accessing plugins help files.
      It searches in the Plugins folder and its sub-folders for pdf,doc,chm,html files and builds a list from which you can select the file to read.
      Select Plugins menu > Plugins Help files
      😉


      ENGLISH version. Put in Plugins folder.


      Version FRANCAISE. A mettre dans le dossier Plugins.

      DB

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

        ...{... if @ext.include? x.split(".")[1] }

        works for files containing names IF you use this to strip off the suffix/extension

        ...{... if @ext.include? x.split(".").last }

        TIG

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

          OK, here is my try for accessing help files out of Sketchup. It uses the some technics as Didiers script for showing the files, but my attempt scans the Directories in another way and recursively builds a nested menu structure.

          Unfortunately there needs to be a lot checking, because we all know, that we can not access existing menus later.

          Go to http://www.errorinitus.de/ > Software > PluginsHelp

          azuby

          *error initus :: Blocks | CurrentDate | d/Code | extensionmanager | FFlipper | HideEdges | MeasuredArea | ModelHistory | PluginsHelp | PronButton | SAWSO | SCP | SU²CATT

          Bad English? PM me, correct me. :smile:**

          1 條回覆 最後回覆 回覆 引用 0
          • Didier BurD 離線
            Didier Bur
            最後由 編輯

            Azuby,
            That's just what I wanted to do, you beat me on this ! 👍

            DB

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

              Your method fails to find 'help' files within the Plugins directory itself - only does sub-folders ? Should be easy enough to fix... BUT it is very slow at start up building the list. I still think a dialog solution that builds the list as you want it is better...

              TIG

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

                Yes, it is slow. It is a try, not a well to use Plugin. And you are right with the Plugins and Tools menu 😳

                It is slow because of many checks for folder content and because I don't want to have empty submenus.

                Figure that out:

                • Plugins : check for contained help files in its subdirectorys *
                  -- a : check for contained help files in it and its subdirectorys *
                  --- a1 : check for contained help files in it and its subdirectorys *
                  ---- a11 : check for contained help files in it and its subdirectorys *
                  --- a2 : check for contained help files in it and its subdirectorys *
                  -- b : check for contained help files in it and its subdirectorys *
                • and if it containeds help files, build a submenu.

                a11 gets checked 4 times if it contains help files. The more nested the folder structure the more time will be need.

                OK, who's next with a solution? [b]Idea[b]: Scan the folders with Dir.glob and create a WebDialog containing links to the help documents in a frameset.

                azuby

                *error initus :: Blocks | CurrentDate | d/Code | extensionmanager | FFlipper | HideEdges | MeasuredArea | ModelHistory | PluginsHelp | PronButton | SAWSO | SCP | SU²CATT

                Bad English? PM me, correct me. :smile:**

                1 條回覆 最後回覆 回覆 引用 0
                • fredo6F 離線
                  fredo6
                  最後由 編輯

                  TIG,

                  There is an error, due to a missing closing brace '}' on line 22.

                  Otherwise, it seems to work, though I may prefer to have the menu / submenu version (one suggestion would be to build the submenus at first call, rather that systematically at load time).

                  Thanks a lot

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

                    @unknownuser said:

                    TIG,

                    There is an error, due to a missing closing brace '}' on line 22.

                    Otherwise, it seems to work, though I may prefer to have the menu / submenu version (one suggestion would be to build the submenus at first call, rather that systematically at load time).

                    Thanks a lot

                    Fixed it !

                    TIG

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

                      Here's my reworking of Didier's script for a dialog version. It makes an alphanumeric list of any plugins' help files. in the resulting window it displays the path in the top bar etc. It appears in the 'Help' menu, but it is easily changeable to appear in 'Plugins'. It is fast...

                      Thanks Fredo6 - must've hit a key between testing it and uploading it !!! corrected script re-uploaded !


                      plugins_help_TIG.rb

                      TIG

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

                        @unknownuser said:

                        [...] though I may prefer to have the menu / submenu version (one suggestion would be to build the submenus at first call, rather that systematically at load time).
                        Please excuse, do you mean my version? A "build menu on demand" is possible. I'll do it soon, at this moment my Sketchup processes a really huge modell (250.000 points, 60.000 faces) and isn't usable 😉

                        azuby

                        *error initus :: Blocks | CurrentDate | d/Code | extensionmanager | FFlipper | HideEdges | MeasuredArea | ModelHistory | PluginsHelp | PronButton | SAWSO | SCP | SU²CATT

                        Bad English? PM me, correct me. :smile:**

                        1 條回覆 最後回覆 回覆 引用 0
                        • fredo6F 離線
                          fredo6
                          最後由 編輯

                          Azuby,

                          In theory, we could imagine that a user would not call a PDF at each Skecthup session, and if he does, after all, he could wait a little bit.
                          But your macro is fast enough that this fine too. When we have hundreds of PDF and HTML documenting scripts, we could revisit the problem 😉

                          All this proves that we have a damned good team of Ruby script programmers on this forum, as it took less than 24 hours to get 3 good versions after the idea just popped up.

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

                            For this, the folder structure is also important, because the deeper the structure the slower tht menu building. So we really could do it better (because for the WebDialog frames version we only need ONE folder scan).

                            azuby

                            *error initus :: Blocks | CurrentDate | d/Code | extensionmanager | FFlipper | HideEdges | MeasuredArea | ModelHistory | PluginsHelp | PronButton | SAWSO | SCP | SU²CATT

                            Bad English? PM me, correct me. :smile:**

                            1 條回覆 最後回覆 回覆 引用 0
                            • W 離線
                              watkins
                              最後由 編輯

                              Dear TIG,

                              Do you think you could modify your script to include simple text documents? I ask because when I install a plugin which isn't supplied with a help/readme document (more recently a .pdf file), I create my own help/readme document by making a simple text file and then cutting and pasting any explanation posted with the ruby script. I now have quite a few of these 'readme' files and it would be really useful if I could access them from the Help drop-down menu.

                              Many thanks,
                              Bob

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

                                I would go a step further and automatically parse out the header text from the script itself.

                                In fact would go even further and suggest authors adopt RDoc, or a similar embedded documentation scheme. RDoc is pure ruby, can be included in the Plugins folder, and creates nicely formatted documentation.

                                Hi

                                1 條回覆 最後回覆 回覆 引用 0
                                • EdsonE 離線
                                  Edson
                                  最後由 編輯

                                  didier,

                                  look what happened to your script on mac: there seems to be a problem as it does not see all i have and does not return anything. after this post i there is one on TIG version of the script, that appears to be working.

                                  the script shows in the menu plugins
                                  what it foundthe result: nothing?

                                  edson mahfuz, architect| porto alegre • brasil
                                  http://www.mahfuz.arq.br

                                  1 條回覆 最後回覆 回覆 引用 0
                                  • EdsonE 離線
                                    Edson
                                    最後由 編輯

                                    TIG,

                                    this is what happened to your script on mac: it seems to be working fine.

                                    it shows on the help menuit found 3 rather than 2 items


                                    it returns the path to the info for that plugin, as intended

                                    edson mahfuz, architect| porto alegre • brasil
                                    http://www.mahfuz.arq.br

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

                                      @edson said:

                                      TIG,
                                      this is what happened to your script on mac: it seems to be working fine.

                                      [attachment=2:2kcjb1a2]<!-- ia2 -->PluginsListB_01.png<!-- ia2 -->[/attachment:2kcjb1a2][attachment=1:2kcjb1a2]<!-- ia1 -->PluginsListB_02.png<!-- ia1 -->[/attachment:2kcjb1a2]

                                      So Edson, you are saying that my version works OK ?

                                      Note: the reason mine lists one more help-file than the other version is that it looks in all of the sub-folders in the Plugins folder and lists any it finds in there too...

                                      TIG

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

                                        @watkins said:

                                        Dear TIG,

                                        Do you think you could modify your script to include simple text documents? I ask because when I install a plugin which isn't supplied with a help/readme document (more recently a .pdf file), I create my own help/readme document by making a simple text file and then cutting and pasting any explanation posted with the ruby script. I now have quite a few of these 'readme' files and it would be really useful if I could access them from the Help drop-down menu.

                                        Many thanks,
                                        Bob

                                        The problem is that many people add a .txt suffix to the end of the name of any scripts they don't want to have always loaded - they can 'load "script.txt"' through the Ruby Console later if needed. If the help script listed all .txt files these would come up in the list too. The formats that are found and listed are pdf htm html mht and doc - so you could make the txt files into doc ones ? OR you could make your help files end with a suffix .bob and set .bob files always to open with NotePad.exe; then edit the script and add ".bob" to the list of files it finds - easy to see how it works - and off you go...

                                        TIG

                                        1 條回覆 最後回覆 回覆 引用 0
                                        • W 離線
                                          watkins
                                          最後由 編輯

                                          Dear TIG,

                                          Many thanks for your helpful suggestions. I will give it a go.

                                          Kind regards,

                                          .bob

                                          1 條回覆 最後回覆 回覆 引用 0
                                          • W 離線
                                            watkins
                                            最後由 編輯

                                            Dear TIG,

                                            I wrote before thinking (not unusual). I simply added "txt" to the list as I almost never load scripts using 'load "script.txt"' through the Ruby Console. This is a quick fix, although I should think about doing what you suggested in the future and loading little used scripts via the Ruby Console.

                                            Kind regards.
                                            .txt

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

                                            Advertisement