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!
    🔌 Smart Spline | Fluid way to handle splines for furniture design and complex structures. Download

    [Plugin] Volume Calculator2...

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

      Having slept on it you would probably want to find the volume of faces that slope too. This version does that - a fully 'vertical' face has 0x volume and a fully 'flat' face has 1x; while at 45 degrees it'll be 0.707x [1/sqrt(2)] of its flat cousin with the same surface area

      v=0;b=Geom;;BoundingBox.new;m=Sketchup.active_model;s=m.selection;s.each{|e|(b.add(e.bounds);v=v+(e.area*e.normal.z.abs))if e.class==Sketchup;;Face};if v>0;t="Faces>Volume";r=inputbox(["Depth;","Units;"],['1"'.to_l,"cuyds"],["","cuyds|cu'|cu\"|m3|cm3|mm3"],t);if r;v=v*r[0];case r[1];when "cuyds";f=0.000021433470507545;when "cu'";f=0.000578703703703704;when "m3";f=0.000016387064;when "cm3";f=16.387064;when "mm3";f=16387.064;else;f=1.0;end;v=sprintf("%.6f ",(v*f));p=b.max;m.start_operation(t);m.active_entities.add_text((v+r[1]),p,[10,10,10]);m.commit_operation;else;p 'Canceled.';UI.beep;end;else;p 'No Faces!';UI.beep;end
      

      This 'one-liner' version now asks for the depth and units, and then puts a piece of Text at the selected faces' max bounds.

      To make it into a proper tool do this...
      Make a file called 'VolumeFaces.rb' in the Plugins folder and add this code

      require 'sketchup.rb'
      module TIG
      def self.volumefaces()
      v=0;b=Geom;;BoundingBox.new;m=Sketchup.active_model;s=m.selection;s.each{|e|(b.add(e.bounds);v=v+(e.area*e.normal.z.abs))if e.class==Sketchup;;Face};if v>0;t="Faces>Volume";r=inputbox(["Depth;","Units;"],['1"'.to_l,"cuyds"],["","cuyds|cu'|cu\"|m3|cm3|mm3"],t);if r;v=v*r[0];case r[1];when "cuyds";f=0.000021433470507545;when "cu'";f=0.000578703703703704;when "m3";f=0.000016387064;when "cm3";f=16.387064;when "mm3";f=16387.064;else;f=1.0;end;v=sprintf("%.6f ",(v*f));p=b.max;m.start_operation(t);m.active_entities.add_text((v+r[1]),p,[10,10,10]);m.commit_operation;else;p 'Canceled.';UI.beep;end;else;p 'No Faces!';UI.beep;end
      end
      unless file_loaded?(File.basename(__FILE__))
        UI.menu("Plugins").add_item("Volume from Faces..."){TIG.volumefaces()}
      end#menu
      file_loaded(File.basename(__FILE__))
      end
      

      It then appears in Plugins Menu under 'Volume from Faces...', select faces and run it, set the dialog options as desired etc... 🤓

      TIG

      1 條回覆 最後回覆 回覆 引用 0
      • pilouP 離線
        pilou
        最後由 編輯

        Ah damned there is no right button on Mac? 😞
        But as writed in the header there is also a Menu on the top line 😄

        Because Menu volume is on contextuel menu on right clic button !

        you must have also sketchup.rb in the folders Plugins!
        Maybe it's for that you don't see that!

        works fine wtih the free one! ☀


        %(#FF4000)[Moderator note from thomthom:
        I removed the sketchup.rb file as it not be needed to distribute this. Each SketchUp version needs a specific version, otherwise odd bugs can appear. The file should also not be in the Plugins folder. (Might have been true many many versions ago, but for the last few it should be in the Tools folder.)]

        Frenchy Pilou
        Is beautiful that please without concept!
        My Little site :)

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

          plz upload v1.8 bro TIG !!!
          Thank u very much !

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

            @duchuy2001 said:

            plz upload v1.8 bro TIG !!!
            Thank u very much !
            If you go the the SCF Plugins Index page - menu linked above - and use your browser's find function [ctrl+F?] for 'volume' you'll find all of the volume tools listed in their own threads - v1.8 has its own thread... 😒
            Please learn to use the basic SCF forum and browser-page search/find tools it will be to your advantage...

            TIG

            1 條回覆 最後回覆 回覆 引用 0
            • taouririT 離線
              taouriri
              最後由 編輯

              thnxxxxxxxxxxxxx
              http://sketchucation.com/forums/download/file.php?avatar=184255_1363259449.jpg

              1 條回覆 最後回覆 回覆 引用 0
              • G 離線
                guntis.rat
                最後由 編輯

                Tig, would it be possible to make plugin that calculates volume between two terrain surfaces.
                Say you have existing ground surface in one group and planed ground surface in other, and you want to know how much you are excavating.
                Or maybe there already are such plugin?

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

                  The version 1 of the tool has a cut-and-fill example.
                  You need to do several steps...
                  You need to find whats removed AND what's added...

                  Or make the two terrains into solids by adding a 'skirt' - I think sdmitch wrote a tool to do that...
                  Then intersect the two using solid-tools and the remainder is the volume...

                  TIG

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

                    There's a new future-proofed update.
                    http://sketchucation.com/forums/viewtopic.php?p=16067#p16067

                    TIG

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

                      thanks TIG finally it's work fine

                      1 條回覆 最後回覆 回覆 引用 0
                      • robertWanR 離線
                        robertWan
                        最後由 編輯

                        @unknownuser said:

                        TIG: VolumeCalculator2
                        Report an object's volume in chosen units and export data to CSV

                        How generate CSV report? SU8.
                        😄

                        Robert

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

                          @robertwan said:

                          @unknownuser said:

                          TIG: VolumeCalculator2
                          Report an object's volume in chosen units and export data to CSV

                          How generate CSV report? SU8.
                          😄

                          Robert
                          Open the RB file in a plain text editor [like Notepad++] and read the usage notes at the start...

                          @unknownuser said:

                          ...The new 'Volume' groups are given an attribute to identify them.
                          If you select one you'll get an extra context-menu option:
                          "Volume >>> CSV", this makes a list of [active] tagged volumes...

                          TIG

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

                            thank you very much, it still works and i tried to donate

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

                            Advertisement