sketchucation logo sketchucation
    • Login
    🤑 SketchPlus 1.3 | 44 Tools for $15 until June 20th Buy Now

    [Plugin] ComponentReporter+.rb

    Scheduled Pinned Locked Moved Plugins
    44 Posts 11 Posters 25.1k Views 11 Watching
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • TIGT Offline
      TIG Moderator
      last edited by

      I was asked to rehash my old script to make a bigger report. It now makes two csv's - one of the Component Definitions that have been used [def-name, number, description and guid] AND the other of the Instances that have been placed [def-name, inst-name, layer, material, area(of faces), ID and bounding-box's xyz]...PayPalButton


      ComponentReporter+.rb

      TIG

      1 Reply Last reply Reply Quote 0
      • H Offline
        Howard leslie
        last edited by

        TIG,
        Thanks once again for another of your fantastic scripts.
        Mega useful
        ...
        Regards
        Howard L'

        1 Reply Last reply Reply Quote 0
        • TIGT Offline
          TIG Moderator
          last edited by

          Here's v1.1.

          It now looks to see if there's a Selection containing at least one Component, if so then you are asked if you want to base the report on the Selection. If 'Yes' then the Instances report is limited to the Selection's Component Instances: if 'No' then a full report is made on all of the Model's Component Instances. In either case a report of all the Model's Components (Definitions) is made first.PayPalButton


          ComponentReporter+.rb

          TIG

          1 Reply Last reply Reply Quote 0
          • TIGT Offline
            TIG Moderator
            last edited by

            Here's v1.2

            It now offers the opportunity to 'Mine' down through nested-groups/components - either all or in a selection - and then report on all component instances it finds.PayPalButton


            ComponentReporter+.rb

            TIG

            1 Reply Last reply Reply Quote 0
            • TIGT Offline
              TIG Moderator
              last edited by

              Here's v1.3
              Much as v1.2 but...

              The error message if the report was already made and left open in Excel so it can't be written to with a new report is now disabled pending a proper implementation.

              If the script fails it is likely the cause is this - close the report and re-run.PayPalButton


              ComponentReporter+.rb

              TIG

              1 Reply Last reply Reply Quote 0
              • TIGT Offline
                TIG Moderator
                last edited by

                Here's v1.4

                Main Changes:
                Report always located with Model.
                Miner goes whole depth of nesting.
                Commas in names etc trapped into ';'.
                3rd report of 'parentage' added.
                If any report is already open error now trapped.PayPalButton


                ComponentReporter+.rb

                TIG

                1 Reply Last reply Reply Quote 0
                • TIGT Offline
                  TIG Moderator
                  last edited by

                  Here's v1.5

                  Areas now report in current units, NOT always sq in.
                  Note: if you always work in say mm but want areas in say sq m then edit the script around lines ~155-165 - there are guidance notes there on how to fix it easily...PayPalButton


                  ComponentReporter+.rb

                  TIG

                  1 Reply Last reply Reply Quote 0
                  • Didier BurD Offline
                    Didier Bur
                    last edited by

                    Little typo line 189 "intances" for "instances".
                    Nice script as always 😄

                    DB

                    1 Reply Last reply Reply Quote 0
                    • TIGT Offline
                      TIG Moderator
                      last edited by

                      @didier bur said:

                      Little typo line 189 "intances" for "instances".
                      Nice script as always :thup:

                      Didier

                      Thanks for those 'eagle-eyes' of yours.

                      Since the typo is only in the text in an error dialog that shouldn't appear much anyway I'll leave it until v1.6...

                      TIG

                      1 Reply Last reply Reply Quote 0
                      • S Offline
                        santiagom
                        last edited by

                        The old component reporter seemed to work on osx, the new one gives me this error. The model is saved.


                        Imagen 1.png

                        1 Reply Last reply Reply Quote 0
                        • TIGT Offline
                          TIG Moderator
                          last edited by

                          Here's v1.6.

                          It sorts out file/folder paths slightly differently, which might avoid the Mac crash. It also corrects the typo in a dialog reported by Didier...PayPalButton


                          ComponentReporter+.rb

                          TIG

                          1 Reply Last reply Reply Quote 0
                          • S Offline
                            santiagom
                            last edited by

                            Works ok now TIG

                            Thanks a lot

                            1 Reply Last reply Reply Quote 0
                            • C Offline
                              clausgs
                              last edited by

                              @santiagom said:

                              Works ok now TIG

                              Thanks a lot

                              Hi TIG

                              I have start using the component reporter with some of my projects..
                              I use it to drag out the size of each component... so that parts is ok..

                              I like to add some more information to each component so i have tried to add some text in the "NAME" input fild on the "Entity info" window, but that do not show up in the report... can that be fixed???

                              hope you are still working on this great RB...!!!

                              1 Reply Last reply Reply Quote 0
                              • B Offline
                                Buildermax
                                last edited by

                                @tig said:

                                Here's v1.6.

                                It sorts out file/folder paths slightly differently, which might avoid the Mac crash. It also corrects the typo in a dialog reported by Didier...

                                Hi, TIG
                                I use this reporter a lot, to quantify timber and steel etc. It’s a great tool but I was wondering if numbers or texts(unit, mm) can be fully separated into different spreadsheet cells, So that I can easily get into the numbers? Also, the approximation mark “~”, Can you make that not get exported as well?

                                Best regards
                                Max

                                Just love SU

                                1 Reply Last reply Reply Quote 0
                                • TIGT Offline
                                  TIG Moderator
                                  last edited by

                                  @buildermax said:

                                  @tig said:

                                  Here's v1.6.

                                  It sorts out file/folder paths slightly differently, which might avoid the Mac crash. It also corrects the typo in a dialog reported by Didier...

                                  Hi, TIG
                                  I use this reporter a lot, to quantify timber and steel etc. It’s a great tool but I was wondering if numbers or texts(unit, mm) can be fully separated into different spreadsheet cells, So that I can easily get into the numbers? Also, the approximation mark “~”, Can you make that not get exported as well?

                                  Best regards
                                  Max

                                  It's not something I can do soon... To avoid the units in the numbers you could try changing your unit settings in the Model Info to avoid having 123mm > 123 ? To get rid of the ~ ?

                                  Here's how to do it yourself... You can strip selected text out of a file using a stream-editor technique, here's an example of code that you'd type/paste into the Ruby Console...
                                  [I've just called the file/path 'Temp' and 'Report.csv' for simplicity - yours will be different - you can copy the path/name from the file's properties... BUT note you need to double up any \ to \ [or make every \ a /] - a single \ is a special-code character in Ruby string-land and it WILL fail to work as expected ! !]

                                  
                                  file1="C;\\Temp\\Report.csv"; file2=File.new("C;\\Temp\\ReportFIXED.csv","w")
                                  IO.readlines(file1).each{|line|file2.puts(line.gsub("mm,", ",").gsub("~", ""))}; file2.close
                                  
                                  

                                  You should now have the contents of file1 copied into file2 BUT with the 'mm' or '~' missed out...
                                  Note - if it were say '~ 123 mm' just change the gsub details to (" mm,",",") and/or ('~ ',"")...
                                  The reason I choose ("mm,",",") is that I only want to change 'mm' at the end of a field and the separator is a comma

                                  Alternatively, if you are a bit frightened of experimenting with coding then you can simply edit the .csv file using 'open-with' NotePad.exe [it's simply a text file with lines of Comma Separated Variables [CSV] that's readable in Excel etc] and then do a 'Find+Replace' on 'mm,' >>> ',' [Replace all] and '~' >>> '' [Replace all] etc and save it...

                                  Let me know how you get on...

                                  TIG

                                  1 Reply Last reply Reply Quote 0
                                  • B Offline
                                    Buildermax
                                    last edited by

                                    Hi, TIG

                                    Thanks for your time and advice but I am not very confident to deal with programming stuff. I prefer to edit the data in excel like the way you suggest, while waiting for the next version. I hope it could be more interactive and controllable.

                                    By the way, to delete tilde ~ (along with some other symbols) by Find and Replace function of MS Excel, a ~ must be added in the selection field first, making it ~~, ~*, and etc.

                                    Regards

                                    Just love SU

                                    1 Reply Last reply Reply Quote 0
                                    • TIGT Offline
                                      TIG Moderator
                                      last edited by

                                      @buildermax said:

                                      Hi, TIG

                                      Thanks for your time and advice but I am not very confident to deal with programming stuff. I prefer to edit the data in excel like the way you suggest, while waiting for the next version. I hope it could be more interactive and controllable.

                                      By the way, to delete tilde ~ (along with some other symbols) by Find and Replace function of MS Excel, a ~ must be added in the selection field first, making it ~~, ~*, and etc.

                                      Regards

                                      I wasn't suggesting you used Find+Replace in Excel itself. If you double-click the file icon it will open in Excel, BUT if you open the file using the right-click context-menu 'Open with...', and select NotePad.exe and use the easier Find+Replace there, then save, the file is changed and when you open it in Excel they'll be no 'mm' or '~'. A 'csv' file is NOT a special Excel format, it's written in simple text with commas separated variables ("CSV"), it can most easily be edited with a text editor... However, Excel IS the default program to open csv files when you double-click since they are a special way of getting data out of one application into Excel without the hassle of binary encoding the fields (.tsv is similar = 'tab-separated-variables') !!! I thought you might be a bit wary of coding ! 😄 However, why not try it on a copy of the file... you'll be proud you did it 😛 - stand up and be a man ! 😉

                                      TIG

                                      1 Reply Last reply Reply Quote 0
                                      • W Offline
                                        Walter S. Arnold
                                        last edited by

                                        Bump of an old thread, but I want give thanks for this plugin; it really came in handy today.

                                        1 Reply Last reply Reply Quote 0
                                        • C Offline
                                          clayc54
                                          last edited by

                                          Hi

                                          im using component reporter and im getting some strange behaviour.

                                          i open a new file, drag in a component. do a report. it shows the component. i then add another component with nested components within. do another report. all good.

                                          when i delete the first component and then do a report, all reports show the deletion except the component+report.csv. its appearing to have a memory.

                                          has anyone else experienced this?

                                          1 Reply Last reply Reply Quote 0
                                          • TIGT Offline
                                            TIG Moderator
                                            last edited by

                                            There is a newer '..++' version that might avoid this ?

                                            TIG

                                            1 Reply Last reply Reply Quote 0
                                            • 1
                                            • 2
                                            • 3
                                            • 1 / 3
                                            • First post
                                              Last post
                                            Buy SketchPlus
                                            Buy SUbD
                                            Buy WrapR
                                            Buy eBook
                                            Buy Modelur
                                            Buy Vertex Tools
                                            Buy SketchCuisine
                                            Buy FormFonts

                                            Advertisement