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

    [Request] - Component's options report

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

      From this:
      2010-08-12_185248.jpg

      to this:
      2010-08-12_185329.jpg

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

        ❓
        Isn't that what you get from File -> Generate Report ?

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

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

          Not exactly - a lot of useless info, no quantities and only inches:

          2010-08-12_205048.jpg

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

            TIG has something but not exactly: http://rhin.crai.archi.fr/rubylibrarydepot/plugin_details.php?id=75

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

              Two more - nothings works.
              http://rhin.crai.archi.fr/rubylibrarydepot/plugin_details.php?id=551
              http://rhin.crai.archi.fr/rubylibrarydepot/plugin_details.php?id=487

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

                Up.

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

                  So, nobody knows a way to use all this data that we can put in an dynamic component? I tried with Generate report but it's useless - with 60-70 components it freezes SketchUP and the report is a real mess! I think this attributes can be a shortest way to have some BOM inside SketchUP!

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

                    I'm keep on searching for a solution and found this - http://code.google.com/intl/bg/apis/sketchup/docs/tutorial_attrreporting.html

                    But getting error when trying to load it:

                    C;\Program Files\Google\Google SketchUp 7\Plugins\attrreporter.rb;199; warning; parenthesize argument(s) for future version
                    Error; #<SyntaxError; C;\Program Files\Google\Google SketchUp 7\Plugins\attrreporter.rb;163; syntax error
                      # Clean up any point rounding weirdness for purposes of display andfilename.split('.').last
                                                                                                           ^
                    C;\Program Files\Google\Google SketchUp 7\Plugins\attrreporter.rb;199; syntax error
                      #      the value of the attribute, or nil if it can't determine that
                                                                           ^
                    C;\Program Files\Google\Google SketchUp 7\Plugins\attrreporter.rb;538; syntax error>
                    C;/Program Files/Google/Google SketchUp 7/Plugins/rubytoolbar.rb;135;in `load'
                    C;/Program Files/Google/Google SketchUp 7/Plugins/rubytoolbar.rb;135;in `rt_load'
                    C;/Program Files/Google/Google SketchUp 7/Plugins/rubytoolbar.rb;180
                    C;/Program Files/Google/Google SketchUp 7/Plugins/rubytoolbar.rb;180;in `call'
                    
                    1 條回覆 最後回覆 回覆 引用 0
                    • TIGT 離線
                      TIG Moderator
                      最後由 編輯

                      There's an error in that published script ! 😒
                      I suspect that

                      value = value.gsub(/\"/,'"')
                      value = value.gsub(/\'/,''')
                      return value
                      

                      should be

                      value = value.gsub(/\"/,'"')
                      value = value.gsub(/\'/,'"')
                      return value
                      

                      around line #159..............

                      TIG

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

                        Well TIG, I am not a coder but to my eyes, the two sniplets look exactly alike. 😒


                        Edit; found the difference!

                        Gai...

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

                          ' ' ' >> ' " '
                          One 'character' is all it takes to **** up a script -
                          is there quality control at Google ??? 😒

                          TIG

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

                            👍 👍 👍 👍 👍 👍

                            2010-08-19_211023.jpg

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

                              SketchUP's Generate Report freezes the program just at 1 components

                              2010-08-19_211533.jpg

                              But this script is working fine so far!!

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

                                Now, that at least we can extract some data is there a way to filtered it. For instance to get components quantity and

                                2010-08-19_214334.jpg

                                2010-08-19_214415.jpg

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

                                  Up.

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

                                    I found a way to convert the inches, but the problem with counting components still remain. Any idea how to include this into the report? 😒

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

                                      Still hoping... 👊

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

                                        Since your example is written in 'Cyrillic' [?] it's hard to understand... Ddo you find the details of a component and also want to show a total number of it in the report - like on the Entity Info window ?
                                        You need to find its definition and then its instances and count them, the format the html/csv to include the 'count' - something like...

                                        ss=model.selection
                                        ents=ss.to_a
                                        ### OR ents=model.entities
                                        ### OR ents=model.active_entities
                                        defns=[] ### to become a list of used definitions
                                        ents.each{|e|
                                          if e.class==Sketchup;;ComponentInstance
                                            defns<< e.definition if not defns.include?(e.definition)
                                          end#if
                                        }
                                        counts=[] ### to become a collection of definitions [by name] and their instance counts [as a string]
                                        defns.each[|d|
                                          counts<< [d.name, d.instances.length.to_s]
                                        }
                                        
                                        
                                        • note it's untested!
                                          You now have an array of selected [or all used] definitions by name, paired with the total of their instances....
                                          So to output it to the Ruby Console use something like...
                                        counts.each{|e|
                                          puts e[0]+"\t"+e[1]
                                        }
                                        

                                        I'll leave the formating of the csv / html lines etc to you or others............. 🤓

                                        TIG

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

                                          Thanks so much! I made a component in English to show what I mean:

                                          2010-08-22_193107.jpg
                                          2010-08-22_193044.jpg

                                          The report is a real mess and in inches, but I managed to clean it up in Excel.

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

                                            So you are almost sorted 😄

                                            TIG

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

                                            Advertisement