• Login
sketchucation logo sketchucation
  • Login
πŸ”Œ Quick Selection | Try Didier Bur's reworked classic extension that supercharges selections in SketchUp Download

Request: Group to Component Plugin

Scheduled Pinned Locked Moved Plugins
14 Posts 6 Posters 1.2k Views 6 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.
  • B Offline
    bmike
    last edited by 24 Jun 2010, 15:55

    I'd be interested in the same... this would be really useful when importing CAD files.

    But I'm not sure how it would know which groups were identical - unless it somehow could compare geometry...?

    mike beganyi design + consulting llc

    1 Reply Last reply Reply Quote 0
    • T Offline
      thomthom
      last edited by 24 Jun 2010, 16:00

      @bmike said:

      I'd be interested in the same... this would be really useful when importing CAD files.

      But I'm not sure how it would know which groups were identical - unless it somehow could compare geometry...?

      Similar groups are not the same as identical groups. If you take a group in SketchUp and copy it about without modifying You'll see in SketchUp's Entity Info window the number of copies there are. These can be easily converted to components with my Selection Toys plugin.
      http://forums.sketchucation.com/viewtopic.php?f=323&t=14975&p=251686

      However, groups that have the same content, but are still unique, in terms of what SketchUp tell you when you select one, can not be converted like that. I have been playing around with this. And once I finish Vertex Tools I will give it another try. If I can get it working I'll include it in my CleanUp plugin.

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

      1 Reply Last reply Reply Quote 0
      • K Offline
        kmead
        last edited by 24 Jun 2010, 16:48

        Thank you, I knew this capability existed (for identical groups), I just couldn't remember which specific tool did it as I generally don't need to do this in this way. I generally try to plan better with creating components in my models.

        Should per chance I end up in Trondheim, I will be more than happy to proffer a cookie or more likely a beer.

        Karl

        I created Dilbertville, sorry about that...

        1 Reply Last reply Reply Quote 0
        • T Offline
          thomthom
          last edited by 24 Jun 2010, 16:53

          @kmead said:

          Should per chance I end up in Trondheim, I will be more than happy to proffer a cookie or more likely a beer.

          Karl

          πŸ‘ πŸ˜„ πŸ‘

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

          1 Reply Last reply Reply Quote 0
          • D Offline
            DavidBoulder
            last edited by 24 Jun 2010, 18:25

            I think an ideal user workflow is to pick the object you want to use as your component and identify it. If it is a group convert it to a component. Once you have identified that, then manually pick all of the groups you want to be replaced with the component, and then have the script automate that.

            I hadn't realized that a group acted like a component until I tried to copy a group into inside, and SketchUp wouldn't let me.

            --

            David Goldwasser
            OpenStudio Developer
            National Renewable Energy Laboratory

            1 Reply Last reply Reply Quote 0
            • B Offline
              bmike
              last edited by 24 Jun 2010, 18:35

              thomthom - nice tools!
              how have i lived so long without them?

              thanks.

              http://www.yorkblog.com/eatersdigest/Cookie Stack.jpg

              mike beganyi design + consulting llc

              1 Reply Last reply Reply Quote 0
              • T Offline
                thomthom
                last edited by 24 Jun 2010, 18:54

                @davidboulder said:

                I think an ideal user workflow is to pick the object you want to use as your component and identify it. If it is a group convert it to a component. Once you have identified that, then manually pick all of the groups you want to be replaced with the component, and then have the script automate that.

                I hadn't realized that a group acted like a component until I tried to copy a group into inside, and SketchUp wouldn't let me.

                If you have selected a bunch of components you can use the Component Browser to replace all selected with the one you right-click in the browser and choose "Replace".

                You can also use this plugin to replace any selected groups / components with one that you pick in the model: http://forums.sketchucation.com/viewtopic.php?f=323&t=26008&p=223994

                The catch here is that often the group/component insertion point differs.

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

                1 Reply Last reply Reply Quote 0
                • C Offline
                  Chris Fullmer
                  last edited by 24 Jun 2010, 19:21

                  I had pretty good success find matching groups inside a model just by comparing geometry. # of faces, edges, types of materials, lengths of all edges, area of all faces. Just that alone starts to find many groups that are identical that could be collapsed into the same component. The next step was to test edge vectors and compare them to make sure all edges were in the same direction. I never got that worked out because that then requires working out the rotation of the group, and potentially the scaling. Or maybe it ends up helping to identify what the rotation is. Again, I never quite got that worked out in my mind.

                  But the idea is do-able. I'm just slowly working on a few other scripts so I will not have time to touch this one any time soon. But I think it would be a great one.

                  Chris

                  Lately you've been tan, suspicious for the winter.
                  All my Plugins I've written

                  1 Reply Last reply Reply Quote 0
                  • T Offline
                    thomthom
                    last edited by 24 Jun 2010, 19:47

                    @chris fullmer said:

                    I had pretty good success find matching groups inside a model just by comparing geometry. # of faces, edges, types of materials, lengths of all edges, area of all faces. Just that alone starts to find many groups that are identical that could be collapsed into the same component. The next step was to test edge vectors and compare them to make sure all edges were in the same direction. I never got that worked out because that then requires working out the rotation of the group, and potentially the scaling. Or maybe it ends up helping to identify what the rotation is. Again, I never quite got that worked out in my mind.

                    I was scribbling down time ideas earlier today (before I even saw this thread). I was thinking that one could start with one vertex in the source, and then look for a vertex in the target that has the same number of edges, faces, face areas, edge lengths.
                    Then when you find a match for that, pick an edge in the source and then a matching edge in the target. Now use Transformation.axis to transform the 3D coordinates of all the vertices of the target into the coordinate system of the source. Now it should be possible to iterate them all to ensure they are identical. If they are you can replace the target with the source and account for the different insertion point and axis.

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

                    1 Reply Last reply Reply Quote 0
                    • D Offline
                      DavidBoulder
                      last edited by 24 Jun 2010, 20:02

                      Maybe you could do some pre-testing with the bounding box, but to deal with rotation you would want to get the relative bounding box of the entities in the group (from within the group) vs. the global bounding box.

                      If two groups have the same bounding box then you can do further testing to see if they are the same.

                      Of course if SU could just turn groups into components on import that would be great.

                      --

                      David Goldwasser
                      OpenStudio Developer
                      National Renewable Energy Laboratory

                      1 Reply Last reply Reply Quote 0
                      • T Offline
                        thomthom
                        last edited by 24 Jun 2010, 20:11

                        @davidboulder said:

                        Of course if SU could just turn groups into components on import that would be great.

                        You'd still have the same problem very often.
                        When I import from Revit, many windows that are in reality the same come in with various insertion points. And some are mirrored.

                        The pre-checks are one thing, good for speeding up comparison - but it's determining the difference between the local co-ordinates of the two objects that is the core problem to tackle.

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

                        1 Reply Last reply Reply Quote 0
                        • P Offline
                          plot-paris
                          last edited by 27 Jun 2010, 07:19

                          such a tool would be of tremendous help! especially when importing models with excessively recurring objects (like trees with thousands of leaves).
                          taking the example of a tree again it is important for the script not only to identify the orientation of similar groups, but to evaluate the scaling as well (defining the scale of the source component as 1).

                          and to make everything perfect this plugin should be able to work on components as well as on groups (because some importers make every object a component, leaving you with a mess and an unaccessible component browser).

                          big task ahead there, thomthom... πŸ˜„

                          1 Reply Last reply Reply Quote 0
                          • T Offline
                            thomthom
                            last edited by 27 Jun 2010, 08:36

                            @plot-paris said:

                            and to make everything perfect this plugin should be able to work on components as well as on groups (because some importers make every object a component, leaving you with a mess and an unaccessible component browser).

                            Revit grumble grumble

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

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

                            Advertisement