Page 1 of 1

Tab-To-(only temporarily)-Hide

Posted: Thu May 16, 2024 8:47 am
by josh
Maybe dumb question before I go to create an ER… TAB key to hide is pretty handy for quickly moving around in assemblies. However, when I’m doing that kind of hiding, I usually want to re-show everything, but only the stuff that I hid using tab. Basically, I want TAB-to-hide to function sort of like Isolate but in reverse. For “permanently” hiding and showing things, I’d rather it not be that easy to do accidentally. I don't want to just show all hidden, because some stuff should stay hidden. I don't want to have to remember all the stuff I hid to see what I was looking for either. Does anyone else feel similar, or am I the weirdo? Or am I just missing some option somewhere…

Re: Tab-To-(only temporarily)-Hide

Posted: Thu May 16, 2024 8:56 am
by AlexLachance
Shift+Tab my friend!

An intern taught us that about 6 months ago, we were all amazed that we weren't aware of it's existance.

Re: Tab-To-(only temporarily)-Hide

Posted: Thu May 16, 2024 9:01 am
by AlexB
The workaround I usually use, mainly because of selecting contact surfaces for simulation, is to us the section view tool. If you create a section view through part or all of the assembly, then select the "Section By Component" with "Include Selected" set. This way I can select the things that will disappear and then click the green check to have a partially shown assembly.

This isn't necessarily an ideal use for the tool because selecting components that are buried beneath other visible components requires the use of the flyout feature tree.

You could also use Ctrl+Shift+Tab to temporarily show hidden components in order to click them to be visible again. You just have to be careful to not let go of the tab button last or it may re-hide the thing under your mouse.

Re: Tab-To-(only temporarily)-Hide

Posted: Thu May 16, 2024 9:12 am
by AlexLachance
AlexB wrote: Thu May 16, 2024 9:01 am The workaround I usually use, mainly because of selecting contact surfaces for simulation, is to us the section view tool. If you create a section view through part or all of the assembly, then select the "Section By Component" with "Include Selected" set. This way I can select the things that will disappear and then click the green check to have a partially shown assembly.

This isn't necessarily an ideal use for the tool because selecting components that are buried beneath other visible components requires the use of the flyout feature tree.

You could also use Ctrl+Shift+Tab to temporarily show hidden components in order to click them to be visible again. You just have to be careful to not let go of the tab button last or it may re-hide the thing under your mouse.
True, show hidden components is also a very neat way of reshowing only what you need. The Shift+Tab is pretty cool but you need to know the exact location of what you want to unhide and you need to know all there is to unhide. The "Show hidden components" kind of removes these hurdles. There's even a neat filter to avoid envelopes showing up.

Re: Tab-To-(only temporarily)-Hide

Posted: Thu May 16, 2024 9:16 am
by josh
Shift+tab is no good...
-I don't want to un-hide any things that were already hidden before I started hiding things. If something big was there but already hidden, Shift-tab will unhide it first.
-I don't want to have to remember which or how many or where things were hidden. I just want to instantly revert to the display before I started hiding things. Similar to the behavior of Select Other when you can right-click on faces to temporarily hide them.

Re: Tab-To-(only temporarily)-Hide

Posted: Thu May 16, 2024 9:20 am
by AlexLachance
josh wrote: Thu May 16, 2024 9:16 am Shift+tab is no good...
-I don't want to un-hide any things that were already hidden before I started hiding things. If something big was there but already hidden, Shift-tab will unhide it first.
-I don't want to have to remember which or how many or where things were hidden. I just want to instantly revert to the display before I started hiding things. Similar to the behavior of Select Other when you can right-click on faces to temporarily hide them.
Hrm, I'm not sure there is any way to do what you desire. There is "isolate" that sorta does that, but I'm pretty sure that's not what you're looking for. Isolate would need you to select everything you want kept...

Perhaps you could do a reverse selection and then isolate to get the result you desire and then quit isolate to get back to what you want..? Just thinking off the top of my head.

Re: Tab-To-(only temporarily)-Hide

Posted: Thu May 16, 2024 9:47 am
by SPerman
Could you write a macro/add-in that runs in the background and keeps track of the items you've hidden, and gives you a button to show them?

Re: Tab-To-(only temporarily)-Hide

Posted: Thu May 16, 2024 9:51 am
by josh
AlexLachance wrote: Thu May 16, 2024 9:20 am Hrm, I'm not sure there is any way to do what you desire. There is "isolate" that sorta does that, but I'm pretty sure that's not what you're looking for. Isolate would need you to select everything you want kept...

Perhaps you could do a reverse selection and then isolate to get the result you desire and then quit isolate to get back to what you want..? Just thinking off the top of my head.
Yep... That's pretty much what I said in my first post :-)

Re: Tab-To-(only temporarily)-Hide

Posted: Thu May 16, 2024 9:52 am
by josh
SPerman wrote: Thu May 16, 2024 9:47 am Could you write a macro/add-in that runs in the background and keeps track of the items you've hidden, and gives you a button to show them?
Yes... Currently considering that option.

Re: Tab-To-(only temporarily)-Hide

Posted: Thu May 16, 2024 9:53 am
by DanPihlaja
If you hit CTRL + SHIFT + TAB, it temporarily shows you what is hidden, and you can select it to show it again. It won't do exactly what you want. But as far as I know it is closest.

Better than SHIFT + TAB because you can select what you want to unhide and not have to cycle through the visible layers of things that are stacked on top of each other.

Re: Tab-To-(only temporarily)-Hide

Posted: Thu May 16, 2024 9:58 am
by DanPihlaja
Also, there is Isolate.

Which does something similar to what you want. (of course, you mentioned isolate in your OP, so this may not work....but for other people looking....)

CTRL select a bunch of things, then RMB on them and select "Isolate"

It hides everything EXCEPT those things. Then gives you a little toolbar to save what is shown as a display state if you want so you can go quickly back to that state. Or "exit Isolate" which just reverts you back to the preview view.
image.png
image.png (7.07 KiB) Viewed 2347 times

Re: Tab-To-(only temporarily)-Hide

Posted: Thu May 16, 2024 10:04 am
by DanPihlaja
You could create a display state right before you start hiding.
Then revert to that display state to get back to what you want.

Even if you write a macro, this may be the way to do it.

Re: Tab-To-(only temporarily)-Hide

Posted: Thu May 16, 2024 11:17 am
by bnemec
SPerman wrote: Thu May 16, 2024 9:47 am Could you write a macro/add-in that runs in the background and keeps track of the items you've hidden, and gives you a button to show them?
josh wrote: Thu May 16, 2024 9:52 am Yes... Currently considering that option.
Seriously? SW cannot get undo/redo to function, why would we ask them to implement an undo stack for tab hide commands? I like the idea, and we would use it frequently; doubtful of an ER implementing that doesn't mess up something else.

I'm guessing their response is use Display States. ()

Re: Tab-To-(only temporarily)-Hide

Posted: Thu May 16, 2024 11:24 am
by AlexLachance
bnemec wrote: Thu May 16, 2024 11:17 am Seriously? SW cannot get undo/redo to function, why would we ask them to implement an undo stack for tab hide commands? I like the idea, and we would use it frequently; doubtful of an ER implementing that doesn't mess up something else.

I'm guessing their response is use Display States. ()
Heck, Isolate messes up display states some times, so I wouldn't hold my breath for SolidWorks to develop a specific case command such as the one Josh seems to require. Maybe I'm not seeing the bigger picture and there would be many more use-case then I can see for it.

Re: Tab-To-(only temporarily)-Hide

Posted: Thu May 16, 2024 11:49 am
by AlexB
Here's a very rough concept of how it may work.

While the user form is active, you can hide whatever components you want
When you're done, click Stop and it will revert any display state changes (hidden -> visible / visible -> hidden) and then close the form

Original GIF (click to view):
TempHide.gif
This could be optimized but a fair bit but it works ok for now. Feel free to download and modify whatever you need.

Edit:
Updated with locking the ui when unhiding to make it faster

Edit 2:
Updated UI and added some error checking.

v2 GIF (click to view):
TempHidev2.gif
Edit 3:
Updated to version 3 which should automatically throw focus back to SW when activated to reduce the number of clicks needed

Re: Tab-To-(only temporarily)-Hide

Posted: Thu May 16, 2024 11:49 am
by Glenn Schroeder
Josh,

If you haven't already answered your daily quota of dumb questions, why not just use display states?

Re: Tab-To-(only temporarily)-Hide

Posted: Thu May 16, 2024 11:55 am
by SPerman
AlexB wrote: Thu May 16, 2024 11:49 am Here's a very rough concept of how it may work.

While the user form is active, you can hide whatever components you want
When you're done, click Stop and it will revert any display state changes (hidden -> visible / visible -> hidden) and then close the form

GIF (click to view):
TempHide.gif

This could be optimized but a fair bit but it works ok for now. Feel free to download and modify whatever you need.
NX had a feature somewhat like this. If you were in the middle of an operation, any object you hid would reappear when you completed that operation. Say you are trying to create a mate, and there are a couple of objects that need to be hidden to access the faces needed for that mate. Once you close the mate creation dialog, everything re-appears. (At least that is how I remember it. NX get's further away in the rear view mirror every day.)

Re: Tab-To-(only temporarily)-Hide

Posted: Thu May 16, 2024 12:04 pm
by Arthur NY
@Glenn Schroeder In this instance what Josh is asking for is something that is very much needed for a VERY long time. How it's been implemented so far is just convoluted and hacked up that it makes no sense.

Display states is not an solution to working in this way because that is not being dynamic while modeling and you have to set things up after they're made. This hiding and unhiding is something that you want to do interactively while trying to get to components or swap out Parts and Assemblies.

Re: Tab-To-(only temporarily)-Hide

Posted: Thu May 16, 2024 12:07 pm
by Arthur NY
What really makes this so VERY poorly implemented is that it is the hot keys cannot be changed aka assigned to new keyboard items. That it is hard coded makes NO sense at all!!!!!

Here's a list of what needs to be in the software....
- Hide : Everything
- Show: Everything
- Hide Selected
- Show Selected: What is hidden is all shown, select what's needed, and only that is what is added to what is shown.
- Isolate: What is selected stays, everything else hides.
- The Hide-Swap: command conceals all visible objects and re-displays all previously hidden objects.

Re: Tab-To-(only temporarily)-Hide

Posted: Thu May 16, 2024 1:01 pm
by JSculley
josh wrote: Thu May 16, 2024 9:16 am -I don't want to have to remember which or how many or where things were hidden. I just want to instantly revert to the display before I started hiding things.
But what is the definition of 'before I started'? Since it isn't a group operation, SW has no idea that two hide operations are related. They could be seconds apart or hours apart.

You could perhaps use ModelDocExtension::StartRecordingUndoObject/FinishRecordingUndoObject. Create two macros, one for starting a group operation and one for finishing. The first just calls StartRecordingUndoObject and the second would call FinishRecordingUndoObject and then at least the undo list would have a single entry to undo. Of course, if any other undoable operations occur between the start and stop they will be undone as well.

Re: Tab-To-(only temporarily)-Hide

Posted: Thu May 16, 2024 2:30 pm
by josh
Glenn Schroeder wrote: Thu May 16, 2024 11:49 am Josh,

If you haven't already answered your daily quota of dumb questions, why not just use display states?
My goal here is for very temporarily hiding components to work on stuff behind or inside them. I don't want to be creating display states or messing with creating section views. I just want to hide these few parts, work on some stuff, then re-show them.

Re: Tab-To-(only temporarily)-Hide

Posted: Thu May 16, 2024 3:48 pm
by Glenn Schroeder
josh wrote: Thu May 16, 2024 2:30 pm My goal here is for very temporarily hiding components to work on stuff behind or inside them. I don't want to be creating display states or messing with creating section views. I just want to hide these few parts, work on some stuff, then re-show them.
That makes sense. Thanks.

I don't know if this will help, but I work with concrete and rebar often, and when I'm placing the rebar I make the concrete transparent. That allows me to see the rebar, and select it when needed, and when I'm finished I click on a face of the concrete and select the "Change Transparency" icon to make it opaque again. That works well for me.

Re: Tab-To-(only temporarily)-Hide

Posted: Thu May 16, 2024 4:21 pm
by josh
This works pretty much like I want... Has to be mapped to a shortcut key, because it works the same as TAB. Unfortunately, I can't map it to TAB. Hover over something and press the shortcut key to hide it. Hit the button, close the form, switch documents, etc. and the components that were hidden by the macro get re-shown. Hit the down arrow on the form and you can see a list of what you've hidden. One quirk... Since it works by hovering rather than clicking, when the userform has focus (right after you run the macro for the first time, or click the down arrow, etc), you have to click back in the graphics area before the shortcut key works again.

Re: Tab-To-(only temporarily)-Hide

Posted: Fri May 17, 2024 3:07 pm
by AlexB
@josh I ended up getting my code to throw focus back to SW using the AppActivate command. It requires the full title of the window as shown in the Task Manager so I can't guarantee it works for all license types (i.e. our network licenses all default to "Premium" regardless of the level we have checked out)

See my post above for version 3 of my macro. It monitors the visibility changes of components so you can use tab to hide items after triggering the user form to show.

Re: Tab-To-(only temporarily)-Hide

Posted: Fri May 17, 2024 3:20 pm
by josh
Thanks! I went the route of getting the window handle of the active view, then GetParent an appropriate number of times to get the handle to SW for SetActiveWindow