sketchucation logo sketchucation
    • Login
    ℹ️ Licensed Extensions | FredoBatch, ElevationProfile, FredoSketch, LayOps, MatSim and Pic2Shape will require license from Sept 1st More Info

    Group dimension

    Scheduled Pinned Locked Moved Plugins
    8 Posts 2 Posters 23 Views 2 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.
    • robertWanR Offline
      robertWan
      last edited by

      Is there a plugin that displays the dimensions of a group after selecting it? I'm looking for a simple way to make a list of furniture items. I know that there are extensive plugins that make a list to a file.

      Robert

      1 Reply Last reply Reply Quote 0
      • Dave RD Offline
        Dave R
        last edited by

        There was an old one that does this:
        Screenshot - 5_10_2023 , 7_32_17 AM.png
        Is that what you are wanting?

        Etaoin Shrdlu

        %

        (THERE'S NO PLACE LIKE)

        G28 X0.0 Y0.0 Z0.0

        M30

        %

        1 Reply Last reply Reply Quote 0
        • robertWanR Offline
          robertWan
          last edited by

          Yes, only I will use it by selecting individual groups (or components) that the furniture consists of.

          Robert

          1 Reply Last reply Reply Quote 0
          • robertWanR Offline
            robertWan
            last edited by

            I found this one, I think:
            https://sketchucation.com/forums/viewtopic.php?f=323&t=28851

            There's only one catch... there is no icon, but maybe a keyboard shortcut will help.

            Robert

            1 Reply Last reply Reply Quote 0
            • Dave RD Offline
              Dave R
              last edited by

              It works on individual components, too.

              @robertwan said:

              There's only one catch... there is no icon, but maybe a keyboard shortcut will help.

              if every plugin you installed had a toolbar there'd be no room to display your model. Either access it from the Extensions menu or set up a keyboard shortcut.

              Question: Are you planning to go through your model and manually get the dimensions of each component or group? That sounds like a lot of work.

              Etaoin Shrdlu

              %

              (THERE'S NO PLACE LIKE)

              G28 X0.0 Y0.0 Z0.0

              M30

              %

              1 Reply Last reply Reply Quote 0
              • robertWanR Offline
                robertWan
                last edited by

                @dave r said:

                set up a keyboard shortcut.

                So I did.

                @dave r said:

                Question: Are you planning to go through your model and manually get the dimensions of each component or group? That sounds like a lot of work.

                I have control over what I want on the list.
                I know that there are dedicated plug-ins for lists of elements, but I think this simple solution will work. There is a small problem.
                Dimension.jpg

                There was probably a plugin that aligns such a rotated group. But that's a detail and probably won't bother me.

                Or is there a simple way to modify the code?

                #-----------------------------------------------------------------------------
                #
                # Copyright 2005, CptanPanic 
                #
                # THIS SOFTWARE IS PROVIDED "AS IS" AND WITHOUT ANY EXPRESS OR
                # IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
                # WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
                #
                #-----------------------------------------------------------------------------
                # Name        ; GetDimensions.rb
                # Type        ; Tool
                # Description ; Displays Dimensions of Component.
                # Menu Item   ; Plugins -> Get Component Dimensions.
                # Context-Menu; None
                # Author      ; CptanPanic
                # Usage       ; Select Component, and call script.
                # Date        ; December 2005
                # Version     ;	1.1			2014 compatible
                # History     ;	1.0			Initial Release.
                #
                #             ; 2010-06 <jim.foltz@gmail.com>
                #               returns "true" dimensions for rotated and scaled Group and Instance.
                #
                #             ; 
                #
                #-----------------------------------------------------------------------------
                
                require 'sketchup.rb'
                
                module JF
                  module GetDimensions
                    VERSION = 1.1
                
                    def self.get_dimensions
                
                      model = Sketchup.active_model
                      selection = model.selection
                
                      ### show VCB and status info...
                      Sketchup;;set_status_text(("GET COMPONENT DIMENSIONS..." ), SB_PROMPT)
                      Sketchup;;set_status_text(" ", SB_VCB_LABEL)
                      Sketchup;;set_status_text(" ", SB_VCB_VALUE)
                
                      ### Get Selected Entities.
                      return unless selection.length == 1
                      e = selection[0]
                      return unless e.respond_to?(;transformation)
                
                      scale_x = ((Geom;;Vector3d.new 1,0,0).transform! e.transformation).length
                      scale_y = ((Geom;;Vector3d.new 0,1,0).transform! e.transformation).length
                      scale_z = ((Geom;;Vector3d.new 0,0,1).transform! e.transformation).length
                
                      bb = nil
                      if e.is_a? Sketchup;;Group
                        bb = Geom;;BoundingBox.new
                        e.entities.each {|en| bb.add(en.bounds) }
                      elsif e.is_a? Sketchup;;ComponentInstance
                        bb = e.definition.bounds
                      end
                
                      if bb
                        dims = [
                          width  = bb.width  * scale_x,
                          height = bb.height * scale_y,
                          depth  = bb.depth  * scale_z
                        ]
                        UI.messagebox("Width;\t#{dims[0].to_l}\nHeight;\t#{dims[1].to_l}\nDepth;\t#{dims[2].to_l}")
                      end
                    end
                  end
                end
                
                ### do menu
                
                if( not file_loaded?("jf_get_dimensions.rb") )
                  menu_name = "[jf] Get Dimensions"
                  UI.menu("Plugins").add_item(menu_name) { JF;;GetDimensions.get_dimensions }
                end#if
                file_loaded("jf_get_dimensions.rb")
                

                Robert

                1 Reply Last reply Reply Quote 0
                • Dave RD Offline
                  Dave R
                  last edited by

                  Like all of the cutlist and other extensions that output dimensions, those dimensions are the size of the bounding box. You need to correctly orient the axes so the bounding box aligns with the geometry.

                  Etaoin Shrdlu

                  %

                  (THERE'S NO PLACE LIKE)

                  G28 X0.0 Y0.0 Z0.0

                  M30

                  %

                  1 Reply Last reply Reply Quote 0
                  • robertWanR Offline
                    robertWan
                    last edited by

                    Yes, I know what the problem is.
                    I have removed the UI.messagebox window and display the results in VCB. Now it works more efficiently. You do not have to close the window after each measurement. Only with PAN or ORBIT the window is cleared.

                    Sketchup;;set_status_text(("#{dims.sort.reverse[0].to_l} x #{dims.sort.reverse[1].to_l} x #{dims.sort.reverse[2].to_l}"), SB_VCB_VALUE)
                    

                    Dimension2.jpg

                    Robert

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

                    Advertisement