sketchucation logo sketchucation
    • Login
    πŸ€‘ SketchPlus 1.3 | 44 Tools for $15 until June 20th Buy Now

    Separate objects in a group.

    Scheduled Pinned Locked Moved Developers' Forum
    7 Posts 3 Posters 246 Views 3 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.
    • M Offline
      Minne Danhieux
      last edited by

      Problem: I have 1 group with multiple objects(planks in my case) inside. Now i'd like to create groups for every object recursivly. I need to detect all connected faces and then group. Take another face, detect object and group.. till done.

      I found the grow selection in quadtools but this is user action based. and grows not entire object directly.

      I dont know if there is a all ready a tool available to do just what i like to do?

      Thx for any help it would save me lots of time. πŸ˜„

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

        The Select tool has several subtleties.
        I assume each plank has 4 visible faces.
        Inside an edit session of the container group.
        To select these you could position your view so you see 2 of them, then click on a face to select it and its edges, now hold down Ctrl to add to the selection and click the next face, now you have 2 faces selected.
        Relocate your view to see the other 2 faces.
        Repeat the Ctrl + click on those.
        You might have an 'outermost' plank with 5 faces !
        Now you have all the needed parts of one plank selected.

        Tips:
        Select + Ctrl adds objects to the selection.
        Select + Ctrl + Shift removes objects from the selection.
        Select + Shift toggles the selected objects - i.e. remove/add.
        One click selects the face.
        Two clicks selects the face and its edges.
        Three clicks selects the face, its edges and all other connected faces and edges.

        An alternative way to Select a plank's faces 'all in one go' is to position you view so you are looking down 'in plan'. Now use the Select tool with a 'fence', dragged right>left through and beyond the visible top face and its 'end edges; this should select everything that the 'fence' crossed, so now all of the plank's faces [and some edges] should be selected.
        The other 'fence' option is a left>right drag with then only selects objects that are wholly with inside the fence.

        Use the 'Make Group' tool to make the selected geometry into a group.
        The selected faces' edges are automatically added to the group with their face.
        Any face's edges that are also used by adjacent unselected faces will be replicated in the group, rather than moved into it.

        Repeat this for other planks.

        Now you have groups of each of the planks.

        The inner planks will not have any 'long sides'.
        As these are not seen you do not have to have them, but if you want them [and they will be needed to make the planks 'solids' if you need this for later operations]. The other adjacent planks will most likely obscure your view when you edit a specific plank-group. BUT if you set View > Component Edit > Hide Rest of Model > ON [which works on Groups as these are just a special kind of Component!] - so when you edit a plank-group the other planks are now hidden temporarily, allowing you to see what you are doing. Over-draw some edges to auto-form the missing faces, and close the edit.

        Tip:
        Use Monochrome mode and a Style that has a distinctly colored back-face material, to ensure all faces are correctly oriented as you edit, if they are not then select and use the context menu 'Reverse', or perhaps 'Orient', tool to fix them...

        TIG

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

          Tig: thx for your big explanation. Unfortunatly I allready know this info.

          Maybe i clearify.

          I allready know what i can do with the selection tool. Also doing like hundreds of planks manualy is a no go. πŸ˜„

          I like to make a tool in RUBY. Hence post in developers forum. Tool must work like this:

          • I go into my planks group.
          • I select all. Faces, Edges, ...
          • Then i execute the tool.
          • The tool detects all face and edges per object inside. (similar to quad tool grow selection on objects)
          • The tool creates a group for ecery serperate object he found in the selected face. Edges.

          Hopefully this explanes the problem better.

          I could use the function of the Quadtools and build a tool myself, but there are maybe tools around that do just this. Or there are better ways to select a full objects inside a group.

          Hopefully it is explained better πŸ˜„

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

            Perhaps something like this simple one-liner? which when copy+pasted + <enter> into the Ruby Console will turn all selected flat/upward-looking faces into individual grouped 'planks' of a specified thickness - it also removes any other selected faces e.g. loose geometry sides and bottom faces and their edges...

            t=20.mm; m=Sketchup.active_model; a=m.active_entities; s=m.selection; m.start_operation('g'); s.each{|e|next unless e.is_a?(Sketchup;;Face) && e.normal==Z_AXIS; g=a.add_group(e); f=nil; g.entities.each{|f|if f.is_a?(Sketchup;;Face); f.pushpull(-t); break; end; }; }; a.erase_entities(s.to_a)if s.to_a[0]; m.commit_operation;
            

            it uses t=20.mm but you can change that to whatever thickness/units you desire, if you want to work in inches simply use say t=0.85 [without any 'units'], or similar...
            It's one step undo-able...

            TIG

            1 Reply Last reply Reply Quote 0
            • Chris FullmerC Offline
              Chris Fullmer
              last edited by

              I wrote a plugin called "Loose to Groups" that does what it sounds like you want. It takes all "loose" geometry and takes the first entity it encounters and finds everything connected to it, then groups it. It then moves on to the next ungrouped geometry and repeats.

              favicon

              (www.smustard.com)

              You can use my plugin as-is or look it over and re-write to suit your needs better. But it should be a good start,

              Chris

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

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

                Tig, alltough it did not yet what i wanted, thx again you are very helpfull!

                Chris, This was exactly what i was looking for. Big Thx! πŸ˜„

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

                  A screen shot of your planks showing them an not being conjoined would have helped zoom in on a solution more quickly.
                  My solution assumes they all touch each other...

                  TIG

                  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