AnsweredAssumed Answered

How to check folder in cut list on included/excluded?

Question asked by Voverrr Mironoff on Jul 1, 2018
Latest reply on Jul 1, 2018 by Voverrr Mironoff

Hello.

I have the multibody part and want to get the number of folders(thanks to Keith), I got it, and then I try to check each folder on including/excluding in  the cut list.

I modified Keith's code:

 

Dim swApp As SldWorks.SldWorks

Dim swModel As SldWorks.ModelDoc2

Dim swFeat As SldWorks.Feature

Dim Foldercount As Integer

Dim EXCL as integer

  

Sub main()

    Set swApp = Application.SldWorks

    Set swModel = swApp.ActiveDoc

    Set swFeat = swModel.FirstFeature

    Foldercount = 0 'number of all folders

    EXCL = 0 'number of excluded folders

 

    While Not swFeat Is Nothing

        If swFeat.GetTypeName = "CutListFolder" Then

            Debug.Print swFeat.Name

            If swFeat.ExcludeFromCutList = True Then                    'here I want to check the folder

            EXCL = EXCL + 1                'count of folders excluded from the cut list

            Debug.Print EXCL

            End If

            Foldercount = Foldercount + 1

        End If

        Set swFeat = swFeat.GetNextFeature

    Wend

    swApp.SendMsgToUser intCount & " folders in the solid bodies folder."

End Sub

 

Thank you.

Outcomes