I've done something stupid and need the braintrust....

So,

I’m designing a mount for a bunch of electronics gear for my homelab. It will be 3D printed, but that really doesn’t matter.

In the process, I did something and now, there is nothing in the window:

image.png
If I highlight the feature, it will display for as long as it’s highlighted.

Any idea what I did and how to undo it?

Unfortunately, I’ve done this in the past and was never able to figure out why.

This is Swx v2023 SP5 if it makes any difference.

cheers,

Are the solid bodies hidden?

Check in the solid bodies folder as Andy suggested. You can also Shift+TAB in the environment, Shift+TAB is “Show hidden” where the mouse is hovering.

You could also right click on the feature and click on the eye so that it shows whatever the feature is attached to, if the issue is that it was hidden.

Now I feel REALLY stupid…

thanks

We’ve all been there UU

The first several times it happened to me I was totally lost! Now I use the “Tab” & “Shift Tab” to hide/unhide things all that time just because I can! UU

Does anyone know of a macro that will unhide all bodies in a multi-body part?

Not a macro, but you can click this and then window everything.

Thank You! I have been looking for that for some time. I normally would go through my feature tree looking at my absorbed sketches looking for sketches that didn’t have bodies showing! On my smaller parts that wasn’t a big issue but on large multibody parts it could take awhile.

If you’re looking for something similar in an assembly you can use this:
image.png

I found a macro for assemblies that unhides everything with 1 button click. I was hoping to find a macro that did the same for multi-body parts.

'**********************
'Copyright(C) 2023 Xarial Pty Limited
'Reference: https://www.codestack.net/solidworks-api/document/assembly/components/show-with-dependents/
'License: https://www.codestack.net/license/
'**********************

Private Declare PtrSafe Function SendMessage Lib "User32" Alias "SendMessageA" (ByVal hWnd As Long, ByVal wMsg As Long, ByVal wParam As Long, lParam As Any) As Long
 
Dim swApp As SldWorks.SldWorks
 
Sub main()
 
     Set swApp = Application.SldWorks
     
     Dim swAssy As SldWorks.AssemblyDoc
     Set swAssy = swApp.ActiveDoc
     
     If Not swAssy Is Nothing Then
     
        Dim swComp As SldWorks.Component2
        Set swComp = swAssy.SelectionManager.GetSelectedObjectsComponent3(1, -1)
        
        If swComp Is Nothing Then
            Set swComp = swAssy.ConfigurationManager.ActiveConfiguration.GetRootComponent3(False)
        End If
        
        ShowWithDependents swComp
        
     Else
        MsgBox "Please open assembly"
     End If
     
 End Sub
 
Sub ShowWithDependents(comp As SldWorks.Component2)
    
    comp.Select4 False, Nothing, False
    
    Const WM_COMMAND As Long = &H111
    Const SHOW_WITH_DEPENDENTS_CMD As Long = 33227
    
    Dim swFrame As SldWorks.Frame
    
    Set swFrame = swApp.Frame
    
    SendMessage swFrame.GetHWnd(), WM_COMMAND, SHOW_WITH_DEPENDENTS_CMD, 0
     
End Sub

Or this (right-click on the file name at the top of the tree).
image.png

I found this macro on the old solidworks forum. I don’t know who to give the credit to, the post says the author is “Solidworks Forums” A big thanks to whoever wrote it.

Dim swApp As Object
Dim model As ModelDoc2
Dim part As PartDoc
Dim BodyArr As Variant
Dim swBody As Body2
Sub main()
Set swApp = Application.SldWorks
Set model = swApp.ActiveDoc
Set part = model
BodyArr = part.GetBodies2(-1, False)
Dim Cnt As Integer

For Cnt = 0 To UBound(BodyArr)
    Set swBody = BodyArr(Cnt)
    If Not swBody Is Nothing Then
        swBody.HideBody (False)
    End If
Next Cnt

End Sub