Tab-To-(only temporarily)-Hide

User avatar
josh
Posts: 304
Joined: Thu Mar 11, 2021 1:05 pm
Answers: 16
x 22
x 514

Tab-To-(only temporarily)-Hide

Unread post 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…
User avatar
AlexLachance
Posts: 2226
Joined: Thu Mar 11, 2021 8:14 am
Answers: 17
Location: Quebec
x 2419
x 2061

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

Unread post 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.
User avatar
AlexB
Posts: 508
Joined: Thu Mar 18, 2021 1:38 pm
Answers: 29
x 274
x 462

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

Unread post 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.
User avatar
AlexLachance
Posts: 2226
Joined: Thu Mar 11, 2021 8:14 am
Answers: 17
Location: Quebec
x 2419
x 2061

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

Unread post 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.
User avatar
josh
Posts: 304
Joined: Thu Mar 11, 2021 1:05 pm
Answers: 16
x 22
x 514

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

Unread post 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.
User avatar
AlexLachance
Posts: 2226
Joined: Thu Mar 11, 2021 8:14 am
Answers: 17
Location: Quebec
x 2419
x 2061

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

Unread post 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.
User avatar
SPerman
Posts: 2080
Joined: Wed Mar 17, 2021 4:24 pm
Answers: 14
x 2256
x 1902
Contact:

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

Unread post 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?
-
I may not have gone where I intended to go, but I think I have ended up where I needed to be. -Douglas Adams
User avatar
josh
Posts: 304
Joined: Thu Mar 11, 2021 1:05 pm
Answers: 16
x 22
x 514

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

Unread post 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 :-)
User avatar
josh
Posts: 304
Joined: Thu Mar 11, 2021 1:05 pm
Answers: 16
x 22
x 514

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

Unread post 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.
User avatar
DanPihlaja
Posts: 862
Joined: Thu Mar 11, 2021 9:33 am
Answers: 25
Location: Traverse City, MI
x 815
x 993

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

Unread post 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.
-Dan Pihlaja
Solidworks 2022 SP4

2 Corinthians 13:14
User avatar
DanPihlaja
Posts: 862
Joined: Thu Mar 11, 2021 9:33 am
Answers: 25
Location: Traverse City, MI
x 815
x 993

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

Unread post 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 6341 times
-Dan Pihlaja
Solidworks 2022 SP4

2 Corinthians 13:14
User avatar
DanPihlaja
Posts: 862
Joined: Thu Mar 11, 2021 9:33 am
Answers: 25
Location: Traverse City, MI
x 815
x 993

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

Unread post 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.
-Dan Pihlaja
Solidworks 2022 SP4

2 Corinthians 13:14
User avatar
bnemec
Posts: 1954
Joined: Tue Mar 09, 2021 9:22 am
Answers: 10
Location: Wisconsin USA
x 2562
x 1411

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

Unread post 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. ()
User avatar
AlexLachance
Posts: 2226
Joined: Thu Mar 11, 2021 8:14 am
Answers: 17
Location: Quebec
x 2419
x 2061

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

Unread post 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.
User avatar
AlexB
Posts: 508
Joined: Thu Mar 18, 2021 1:38 pm
Answers: 29
x 274
x 462

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

Unread post 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
Attachments
TemporaryHide v3.swp
(160.5 KiB) Downloaded 321 times
TemporaryHide v2.swp
(115 KiB) Downloaded 406 times
TemporaryHide.swp
(96 KiB) Downloaded 350 times
User avatar
Glenn Schroeder
Posts: 1527
Joined: Mon Mar 08, 2021 11:43 am
Answers: 23
Location: southeast Texas
x 1777
x 2142

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

Unread post by Glenn Schroeder »

Josh,

If you haven't already answered your daily quota of dumb questions, why not just use display states?
"On the days when I keep my gratitude higher than my expectations, well, I have really good days."

Ray Wylie Hubbard in his song "Mother Blues"
User avatar
SPerman
Posts: 2080
Joined: Wed Mar 17, 2021 4:24 pm
Answers: 14
x 2256
x 1902
Contact:

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

Unread post 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.)
-
I may not have gone where I intended to go, but I think I have ended up where I needed to be. -Douglas Adams
User avatar
Arthur NY
Posts: 198
Joined: Sat Mar 27, 2021 12:32 pm
Answers: 1
x 40
x 175

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

Unread post 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.
User avatar
Arthur NY
Posts: 198
Joined: Sat Mar 27, 2021 12:32 pm
Answers: 1
x 40
x 175

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

Unread post 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.
User avatar
JSculley
Posts: 648
Joined: Tue May 04, 2021 7:28 am
Answers: 55
x 9
x 888

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

Unread post 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.
User avatar
josh
Posts: 304
Joined: Thu Mar 11, 2021 1:05 pm
Answers: 16
x 22
x 514

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

Unread post 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.
User avatar
Glenn Schroeder
Posts: 1527
Joined: Mon Mar 08, 2021 11:43 am
Answers: 23
Location: southeast Texas
x 1777
x 2142

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

Unread post 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.
"On the days when I keep my gratitude higher than my expectations, well, I have really good days."

Ray Wylie Hubbard in his song "Mother Blues"
User avatar
josh
Posts: 304
Joined: Thu Mar 11, 2021 1:05 pm
Answers: 16
x 22
x 514

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

Unread post 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.
Attachments
ReverseIsolate.swp
(96 KiB) Downloaded 358 times
User avatar
AlexB
Posts: 508
Joined: Thu Mar 18, 2021 1:38 pm
Answers: 29
x 274
x 462

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

Unread post 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.
User avatar
josh
Posts: 304
Joined: Thu Mar 11, 2021 1:05 pm
Answers: 16
x 22
x 514

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

Unread post 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
Post Reply