Help undoing my mistakes using Hide rather than Layers

Unhide All from Sketchucation works.

Oh rats! I copied this from one of my unpublished collections and forgot the required helper. It should have been like this:

module SLB_unhide
  def self.unhide_all
     count = 0
     ents = Sketchup.active_model.entities
     Sketchup.active_model.start_operation("SB_unhide_all", true)
     increment = unhide_ents(ents)
     count = count + increment
     defns = Sketchup.active_model.definitions
     defns.each do |defn|
      increment = unhide_ents(defn.entities)
      count = count + increment
    end
    Sketchup.active_model.commit_operation
    puts "#{count} Entities unhidden"
    nil
  end
  def self.unhide_ents(ents)
    count = 0
    ents.each do |ent|
      next unless ent.respond_to?(:hidden?) && ent.hidden?
      ent.hidden = false
      count += 1
    end
    count
  end
end
SLB_unhide.unhide_all

But of course, if you prefer an extension to a one-time script, the UnhideAll one from SketchUcation does the same thing.

1 Like

You should give your script a try. That last version shows unexpected end-of-input. Do you see it working if you paste in the Ruby Console?

When I cut and paste into the console, it runs. Not sure what went wrong for you…maybe didn’t catch everything in the cut and paste?

It’s a forum thing it seems. The code block ended early, but it was possible to scroll to the last few lines. After that it worked.

This updated script worked to unhide all! lets see if it holds as I update scenes.

One issue to this approach. Yes it unhide all the hidden components. However there are hidden parts of the windows which are a dynamic component that turns on an off certain options like window divides. Using this script that unhides all the window divides and does not allow me to control their visibility through dynamic options any longer.

Ouch! That’s a problem. I hope you kept a copy before the changes.

I haven’t looked to check, but I imagine the extension from SketchUcation has the same issue. The script could possibly be tweaked to leave Dynamic Components alone, but because there is no official API for DC’s this would be a hack whose correctness would be hard to assure. It would be safer to manually repair the DC’s after the unhide, but I can see how that might be pretty tedious.

It seems that Discourse has a limit on the size of the frame containing code and adds scrollbars if your code is longer. If there’s a way to enlarge the window, I don’t know it. Maybe @DanRathbun knows?

I found a workaround by copying my windows group into a new document then running the script then copying back my window group into my correct version. THIS seems to have fixed my issues but I’ll keep following up. Thanks again to everyone who has helped

I do have back up versions. I’m on V27 currently with a variant specifically for trying Help Forum solutions. I also have mirrored back ups of every variant on Drop Box as well as my solid state in my MacPro. I’m super SUPER paranoid about losing my files or corruption problems. I’ve at least done that part correctly haha.

1 Like

It is also mainly a Mac thing. The same code in Windows shows a scrollbar. That only appears on Mac when you start scrolling.

It’s a setting in System Preferences → General on Mac. You can choose between “Automatically based on mouse or trackpad”, “when scrolling”, or “Always”. I have it set to “Always” so it didn’t occur to me that you might not realize the code block needed scrolling!

Alright after using this script to unhide items. I’m still having the same objects and components default back to being hidden. I’ve gone through all my scenes 2 times now, I’ll unhide all using the script, then update my scene. After doing the same for 3-4 different scenes the original objects return to being hidden.

I have made a video showing this happening on a specific view that has continually had this issue. The windows and the upper wall keep hiding. Dropbox - Sketchup video.mov - Simplify your life

At this point I’m tempted to explode everything copy my model into a fresh file and start over with a brand new series of views and re group and re-layer everything.

I feel like I’m playing a game of wack-a-mole here.

With regard to code block scrolling ...

It’s a admin setting I believe. I think I remember @jody setting it longer awhile back. It would be nice if Discourse puts some little message or a ellipsis character at the bottom of code blocks that need vertical scrolling. (They’ll no doubt argue that the presence of scrollbars indicates that the code displayed is incomplete.)

I always liked the way that SketchUcation’s BB system could allow collapsing an expanding the code blocks. Also that it automatically adds a download or copy button to “grab” the code in one mouse click. Perhaps there is a Discourse extension that adds similar features to code blocks ?

You ought to be able to update all your scenes in one go. Run the script. Select all your scenes in the scenes tray, Press the Update button in the tray, In the popup window, deselect other options than Hidden Objects and Hidden Geometry.

This topic was automatically closed 183 days after the last reply. New replies are no longer allowed.