sketchucation logo sketchucation
    • Login
    Oops, your profile's looking a bit empty! To help us tailor your experience, please fill in key details like your SketchUp version, skill level, operating system, and more. Update and save your info on your profile page today!
    🫛 Lightbeans Update | Metallic and Roughness auto-applied in SketchUp 2025+ Download

    Ruby to unhide hidden contents in selected group?

    Scheduled Pinned Locked Moved Plugins
    4 Posts 3 Posters 782 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.
    • K Offline
      kaas
      last edited by

      Hello,

      I have lots of groups in my scenes and some of them have objects in them whose lines must be hidden. Now and then I have to edit the lines.

      Of course, I can: open the group -> unhide hidden geometry -> unhide all (in group) -> hide hidden geometry ....
      It would be very useful if I could just select the group and press a button to it all happen.

      Anyone know if there's a plugin that can unhide the contents of a selected group / component?

      Greetings, Max

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

        Since you can't edit those edges without opening the group for editing, why not just set up a keyboard shortcut that operates on the opened group?

        Etaoin Shrdlu

        %

        (THERE'S NO PLACE LIKE)

        G28 X0.0 Y0.0 Z0.0

        M30

        %

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

          View > Hidden Geometry toggles on/off... so you can then see a hidden line and 'edit' it without having to un-hide it at all...
          This code will un-hide all edges in a group you are editing.
          It remembers the edges and when its inverse is run it hides them again.
          Copy+paste the code into a plain text file in the Plugins folder called "TIG-edgehidetoggle.rb". Restart Sketchup to get it to auto-load. To use it edit a group [double-click] and in the Ruby Console type TIG.edgehidetoggle to un-hide all edges, when you are done TIG.edgehidetoggle to hide all of those edges again, obviously erased or new edges are excluded from processing...
          You can easily make a menu item to shortcut to; or a toolbar button...

          require 'sketchup.rb'
          module TIG
            def TIG.edgehidetoggle()
              model=Sketchup.active_model
              ents=model.entities
              ants=model.active_entities
              return if ents==ants
              return unless ants.parent.group?
              unless @hiddenedges and @hiddenedges[0] ### show and remember
                @hiddenedges=[]
                ants.each{|e|@hiddenedges << e if e.class==Sketchup;;Edge and e.hidden?}
                @hiddenedges.each{|e|e.hidden=false} if @hiddenedges[0]
                return 'un-hidden'
              else ### hide and forget
                @hiddenedges.each{|e|e.hidden=true if e.valid?}
                @hiddenedges=[]
                return 'hidden'
              end
            end
          end
          

          TIG

          1 Reply Last reply Reply Quote 0
          • K Offline
            kaas
            last edited by

            TIG - great! Exactly what I was looking for. Especially when working with large scenes my old workflow took some time. With your script, a menu-item & keyboard shortcut it's nice and easy.

            Thanks a lot

            Greetings, Max

            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