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

    Adding objects into a group/component

    Scheduled Pinned Locked Moved SketchUp Discussions
    sketchup
    13 Posts 10 Posters 20.8k Views 10 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.
    • C Offline
      croviax
      last edited by

      How do i add objects into an existing group without exploding the group and grouping back again?

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

        Try
        group.entities.add_instance(other_group.entities.parent, other_group.transformation*group.transformation) other_group.entities.parent.instances[1].material=other_group.material other_group.entities.parent.instances[1].layer=other_group.layer### you can also copy over other attributes of 'other_group' if appropriate
        other_group.erase!

        'other_group' is 'cloned' into 'group.entities' and the original erased - here we also copy its material and layer...

        TIG

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

          I'm sorry, but how do i use that script?

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

            @croviax said:

            I'm sorry, but how do i use that script?

            It's not a script it's a snippet of code... 😕
            Sorry I thought you wanted a Ruby way of doing it... 😒
            To do it by hand do this.
            Select the Object[s] you want to relocate into the Group.
            Use
            Menu > Edit > Cut
            The selection is put it onto the clipboard.
            Double-click the Group so you are editing its entities.
            Use
            Menu > Edit > Paste-in-Place
            The Selected Object[s] now 'moves' into the Group.
            To duplicate it into the Group use
            Menu > Edit > Copy
            To place it into the Group at the same location use the
            Menu > Edit > Paste-in-Place
            BUT to choose where to put it use
            Menu > Edit > Paste
            You then pick its new location inside the Group.
            To 'move' something out of a Group reverse the process...
            Edit the Group.
            Select the Objects to 'move' out.
            Menu > Edit > Cut
            The exit the edit and then
            Menu > Edit > Paste-in-Place
            To put into the Model... or edit another Group and paste the objects into that etc...
            To 'copy' things rather than 'move' their context use Edit > Copy rather than Edit > Cut
            You can do something similar with a Component Instance Edit - to add/move objects etc.

            TIG

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

              Hahah, didn't know the 'Paste in Place' command exist..

              Thanks a lot 😄

              1 Reply Last reply Reply Quote 0
              • T Offline
                Taylor64
                last edited by

                @croviax said:

                Hahah, didn't know the 'Paste in Place' command exist..

                Thanks a lot 😄

                This may be a helpful hint, you can customize your shortcuts on your keyboard, by going to window/preferences then pick short cuts from the menu and set your "paste in place" command to e.g.: "Ctrl-shift-v". I don't know why this isn't in the default settings???
                Also use the common shortcuts such as Ctrl-C for copy and Ctrl-v for paste. I can't remember if sketchup does the Ctrl-d for duplicate.

                make any sense?

                1 Reply Last reply Reply Quote 0
                • pyrolunaP Offline
                  pyroluna
                  last edited by

                  You can also drag a group into another group in the outliner window.
                  Something similar is explained in this video: http://www.youtube.com/watch?v=7OBljxmDLSI

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

                    Thanks TIG and Pyroluna! ...I don't know why these aren't mentioned on the SketchUp doc pages about groups & components; you'd think it would be an obvious followup concern...

                    1 Reply Last reply Reply Quote 0
                    • M Offline
                      mwm5053
                      last edited by

                      WOW Tig, genius, you are the the man, so obvious but never thought of that

                      Thanks

                      2011 iMac
                      SU 2015 Pro, 2017 Make
                      V2 Twilight
                      macOS Sierra 10.12.5

                      1 Reply Last reply Reply Quote 0
                      • G Offline
                        ghanson
                        last edited by

                        This thread is still saving the minds of new SketchUp users!
                        Thanks for the clear explanation and direction.

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

                          Hi , how to add an item to an existing component instances. I mean I have 4 copies of an item in my model , 3 are instances of a component but the forth , for some reason , is not. How do I make it part of the component instances.

                          1 Reply Last reply Reply Quote 0
                          • T Offline
                            thiaguinho
                            last edited by

                            I can attest to the copy and paste in place. Works wonders. However, if there is a lot of geometry that needs to be added, I'd recommend using the outliner and dragging them in there!

                            1 Reply Last reply Reply Quote 0
                            • mariochaM Offline
                              mariocha
                              last edited by

                              @tig said:

                              Try
                              group.entities.add_instance(other_group.entities.parent, other_group.transformation*group.transformation) other_group.entities.parent.instances[1].material=other_group.material other_group.entities.parent.instances[1].layer=other_group.layer### you can also copy over other attributes of 'other_group' if appropriate
                              other_group.erase!

                              'other_group' is 'cloned' into 'group.entities' and the original erased - here we also copy its material and layer...

                              Thanks for this. Was useful.
                              Of course, assigning names (variables) to each instance, makes copying layer straightforward;
                              group2.layer = group1.layer

                              %(#008000)[Mario C.
                              Every rule has exceptions, but some.]

                              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