AnsweredAssumed Answered

macro to hide all visible surfaces in assembly

Question asked by Steven Marcus on Apr 7, 2017
Latest reply on Apr 15, 2017 by Deepak Gupta

I'm trying to piece together a marco which goes through the entire assembly and hides all surface bodies.


Here's what I have



Dim swApp As SldWorks.SldWorks


    Dim swModel As ModelDoc2

    Dim swPart As IPartDoc

    Dim Bodies As Variant

    Dim swBody As IBody2




    Sub main()

    Set swApp = Application.SldWorks

    Set swModel = swApp.ActiveDoc



    Bodies = swPart.GetBodies2(swBodyType_e.swSheetBody, True)


    For Each swBody In Bodies

        swBody.HideBody (True)






    End Sub