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

    Unhide/unsoften edges?

    Scheduled Pinned Locked Moved Plugins
    7 Posts 4 Posters 1.9k Views 4 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.
    • PixeroP Offline
      Pixero
      last edited by

      I'm looking for a script that can iterate through nested groups and unhide/unsoften all edges.
      I've found two scripts but none of them worked for me. "unhide_all.rb" by TBD and Fredos "HideAllEdges.rb" (that also does unhide).
      Is there another script?

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

        Try this one-liner, copy+paste in the Ruby Console + <enter> - it goes through all edges in groups and undoes hidden/soft/smooth.

        m=Sketchup.active_model;m.start_operation('UN...');m.definitions.each{|d|next unless d.group?;d.entities.grep(Sketchup;;Edge).each{|e|e.hidden=false;e.smooth=false;e.soft=false}};m.commit_operation
        

        It's one step undo-able.
        It doesn't process geometry in the model or inside components...
        This version processes groups & model geometry...

        m=Sketchup.active_model;m.start_operation('UN...');m.definitions.each{|d|next unless d.group?;d.entities.grep(Sketchup;;Edge).each{|e|e.hidden=false;e.smooth=false;e.soft=false}};m.entities.grep(Sketchup;;Edge).each{|e|e.hidden=false;e.smooth=false;e.soft=false};m.commit_operation
        

        This one also does the same for all components [groups & model-geometry are ignored]...

        m=Sketchup.active_model;m.start_operation('UN...');m.definitions.each{|d|next if d.group? || d.image?;d.entities.grep(Sketchup;;Edge).each{|e|e.hidden=false;e.smooth=false;e.soft=false}};m.commit_operation
        

        I think you know how to make these into proper Plugins... πŸ€“

        TIG

        1 Reply Last reply Reply Quote 0
        • 3 Offline
          3dsmax9
          last edited by

          try this : http://sketchucation.com/forums/viewtopic.php?t=13645

          1 Reply Last reply Reply Quote 0
          • PixeroP Offline
            Pixero
            last edited by

            Thanks TIG. I will try them.
            3dsmax9, i found that one too but it ran for an hour and then I force quit SU.

            1 Reply Last reply Reply Quote 0
            • PixeroP Offline
              Pixero
              last edited by

              The third one worked. Took some time to run though. Big thanks for the help.

              1 Reply Last reply Reply Quote 0
              • J Offline
                jbrasmartins
                last edited by

                Just found this solution, and it works really great! I'm trying to turn it into a plugin but I don't know how. Is it possible to point me on a direction to make it work please?
                Thanks in advance.

                @tig said:

                Try this one-liner, copy+paste in the Ruby Console + <enter> - it goes through all edges in groups and undoes hidden/soft/smooth.

                m=Sketchup.active_model;m.start_operation('UN...');m.definitions.each{|d|next unless d.group?;d.entities.grep(Sketchup;;Edge).each{|e|e.hidden=false;e.smooth=false;e.soft=false}};m.commit_operation
                

                It's one step undo-able.

                It doesn't process geometry in the model or inside components...
                This version processes groups & model geometry...

                m=Sketchup.active_model;m.start_operation('UN...');m.definitions.each{|d|next unless d.group?;d.entities.grep(Sketchup;;Edge).each{|e|e.hidden=false;e.smooth=false;e.soft=false}};m.entities.grep(Sketchup;;Edge).each{|e|e.hidden=false;e.smooth=false;e.soft=false};m.commit_operation
                

                This one also does the same for all components [groups & model-geometry are ignored]...

                m=Sketchup.active_model;m.start_operation('UN...');m.definitions.each{|d|next if d.group? || d.image?;d.entities.grep(Sketchup;;Edge).each{|e|e.hidden=false;e.smooth=false;e.soft=false}};m.commit_operation
                

                I think you know how to make these into proper Plugins... πŸ€“

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

                  To make a short script to do this...
                  Use Notepad++ [or TextWrangler on MAC] to make a plain-text file that must be UFT8 encoded.
                  Name it say myUN.rb
                  It goes in your user's Plugins folder.
                  Find that using this snippet in the Ruby Console:

                  UI.openURL("file;///#{Sketchup.find_support_file('Plugins')}")
                  

                  Then add one line of text as follows + return, substituting the desired code you wish to run, where I have put CODE [copy paste from the previous examples as desired]; you can also name the menu item as you wish - I've named it "myUN..."

                  UI.menu("Plugins").add_item("myUN..."){CODE}
                  

                  After SketchUp restarts the new menu item should be seen in the Plugins menu - which is now called the 'Extensions' menu in newer SketchUp versions...
                  Select that menu item to run the code...

                  Also remember that you will need the Extension Manager Loading Policy set to Unrestricted to run your own 'unsigned' scripts...

                  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