sketchucation logo sketchucation
    • Login
    โ„น๏ธ Licensed Extensions | FredoBatch, ElevationProfile, FredoSketch, LayOps, MatSim and Pic2Shape will require license from Sept 1st More Info

    [Request] Select only horizontal and vertical faces

    Scheduled Pinned Locked Moved Plugins
    15 Posts 7 Posters 1.3k Views 7 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.
    • Didier BurD Offline
      Didier Bur
      last edited by

      Hi,
      No plugin AFAIK.
      Wait a minute (a day...). I'll code that for u.
      Regards,

      DB

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

        This has been discussed in several threads already... do a search.
        This one-liner copy+pasted+<enter> in the Ruby Console leaves an existing preselection with just the horizontal [up] faces selected

        s=Sketchup.active_model.selection;s.each{|e|s.remove(e)unless e.is_a?(Sketchup;;Face) && e.normal.z==1}
        

        This one does horizontal up & down faces

        s=Sketchup.active_model.selection;s.each{|e|s.remove(e)unless e.is_a?(Sketchup;;Face) && e.normal.z.abs==1}
        

        this one does all vertical faces

        s=Sketchup.active_model.selection;s.each{|e|s.remove(e)unless e.is_a?(Sketchup;;Face) && e.normal.z==0}
        

        There are many permutations you could invent - for example after the desired faces are selected to also select their edges with

        s=Sketchup.active_model.selection;s.each{|e|s.add(e.edges)if e.is_a?(Sketchup;;Face)}
        

        TIG

        1 Reply Last reply Reply Quote 0
        • tt_suT Offline
          tt_su
          last edited by

          @numerobis said:

          Is there a plugin that allows to filter a selection to select only horizontal and vertical faces? And their outer lines? (the second part is not so important, because it can be done by grouping and ungrouping the selection)

          Selection Toys let you do that: http://extensions.sketchup.com/en/content/selection-toys

          1 Reply Last reply Reply Quote 0
          • renderizaR Offline
            renderiza
            last edited by

            We all posted replies very quickly ๐Ÿ˜ฎ ...I love sketchUcation! ๐Ÿคฃ

            [url=https://www.sketchupcode.com/:z3kqsidd]My Extensions ...[/url:z3kqsidd]

            1 Reply Last reply Reply Quote 0
            • renderizaR Offline
              renderiza
              last edited by

              Here is a code example...

              model = Sketchup.active_model
              ents = model.active_entities
              sel = model.selection
              
              faces = sel.grep(Sketchup;;Face)
              edges = sel.grep(Sketchup;;Edge)
              
              faces.each do |face|
              
                if not face.normal.x == 1 || face.normal.y == 1 || face.normal.z == 1 || face.normal.x == -1 || face.normal.y == -1 || face.normal.z == -1
                
                  sel.remove face
                
                end
                
                sel.remove edges
              
              end
              

              Note:forgot to add negative normal...updated the code above. ๐Ÿ˜›

              [url=https://www.sketchupcode.com/:z3kqsidd]My Extensions ...[/url:z3kqsidd]

              1 Reply Last reply Reply Quote 0
              • N Offline
                numerobis
                last edited by

                WOW! ๐Ÿ˜ฎ Thanks a lot for all these quick responses!

                But i'm really a noob when it comes to ruby coding, so please... how can i turn these code parts into a plugin so that i don't have to open the console every time?

                @tt_su said:

                Selection Toys let you do that: http://extensions.sketchup.com/en/content/selection-toys

                Thanks! I already reinstalled them because i thought i had an older version installed. But i still can't it? Maybe i missed it - could you tell me in which section it is located?

                1 Reply Last reply Reply Quote 0
                • tt_suT Offline
                  tt_su
                  last edited by

                  hm... it might not do exactly what you want. If you have a horizontal face you can right click it and in the context menu you can select more faces in the same direction or perpendicular.

                  ...though I did imagine there was already a plugin to select Vertical, Horisontal faces...

                  1 Reply Last reply Reply Quote 0
                  • Rich O BrienR Online
                    Rich O Brien Moderator
                    last edited by

                    Link Preview Image
                    SketchUp Plugins | PluginStore | SketchUcation

                    SketchUp Plugin and Extension Store by SketchUcation provides free downloads of hundreds of SketchUp extensions and plugins

                    favicon

                    (sketchucation.com)

                    Download the free D'oh Book for SketchUp ๐Ÿ“–

                    1 Reply Last reply Reply Quote 0
                    • renderizaR Offline
                      renderiza
                      last edited by

                      @rich o brien said:

                      Link Preview Image
                      SketchUp Plugins | PluginStore | SketchUcation

                      SketchUp Plugin and Extension Store by SketchUcation provides free downloads of hundreds of SketchUp extensions and plugins

                      favicon

                      (sketchucation.com)

                      Great plugin that does what he wants and then some! ๐Ÿ‘

                      [url=https://www.sketchupcode.com/:z3kqsidd]My Extensions ...[/url:z3kqsidd]

                      1 Reply Last reply Reply Quote 0
                      • N Offline
                        numerobis
                        last edited by

                        @rich o brien said:

                        Link Preview Image
                        SketchUp Plugins | PluginStore | SketchUcation

                        SketchUp Plugin and Extension Store by SketchUcation provides free downloads of hundreds of SketchUp extensions and plugins

                        favicon

                        (sketchucation.com)

                        ๐Ÿ‘
                        Thanks Rich! ๐Ÿ˜

                        It works! But now i see that i need a slight variation of "horizontal/vertical". When i select a rounded cube i need to filter out only the orthogonal faces (xy/xz/yz) and not the rounding. With horizontal/vertical the vertical faces of the round corners are selected too. ๐Ÿ˜’

                        Would it be possible to limit the selection to these three directions? And would it work based on a local coordinate system of a component?

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

                          @numerobis said:

                          Is there a plugin that allows to filter a selection to select only horizontal and vertical faces? And their outer lines? (the second part is not so important, because it can be done by grouping and ungrouping the selection)

                          maybe this one, at least for part of what you are looking for

                          http://sketchucation.com/forums/viewtopic.php?f=323&t=54191

                          1 Reply Last reply Reply Quote 0
                          • N Offline
                            numerobis
                            last edited by

                            Thanks, but...

                            @rich o brien said:

                            Link Preview Image
                            SketchUp Plugins | PluginStore | SketchUcation

                            SketchUp Plugin and Extension Store by SketchUcation provides free downloads of hundreds of SketchUp extensions and plugins

                            favicon

                            (sketchucation.com)

                            ๐Ÿ˜‰

                            1 Reply Last reply Reply Quote 0
                            • Didier BurD Offline
                              Didier Bur
                              last edited by

                              Here's my contribution:
                              http://sketchucation.com/forums/viewtopic.php?f=323&t=54894

                              DB

                              1 Reply Last reply Reply Quote 0
                              • N Offline
                                numerobis
                                last edited by

                                Thanks Didier! ๐Ÿ˜Ž

                                But i have two problems using it... ๐Ÿ˜ณ

                                It also selects ALL vertical faces not only the axes oriented ones (same as the s4u_selectool). And it works not in groups/components for me.

                                Maybe i should describe why i need it... ๐Ÿ’š
                                When i use round corner i need to smooth the curve segments but i want the first edge of each rounding to stay unsmoothed to avoid shading problems when i render the model. This method works ok for me without the need of supporting edges.
                                So the best thing would be a "Soften Edges" tool that sets the minimal smoothing angle for each edge and sets the start and end edge to unsmoothed.
                                Maybe this could be an option of the round corner tool.

                                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