AnsweredAssumed Answered

How do you get the view/model associated with a weldment cut list table in a drawing?

Question asked by Matt Fisher on Sep 19, 2016

I've been trying 2 approaches. First, go through the views and see if there is a weldment cut list for this view and if so get the referenced model to do something to it. Second, go through the feature tree looking for cut lists and get the view and model to do something to it.

 

Code for first approach...

    Set swDwg = swDoc

    vSheetNames = swDwg.GetSheetNames

    For Each vSheetName In vSheetNames

        Set swSheet = swDwg.Sheet(vSheetName)

        vViews = swSheet.GetViews

        For Each vView In vViews

            Set swView = vView

            'See if there is a weldment cut list and if so get the referenced model to do something to it.

        Next

    Next

 

Code for second approach...

    Set swFeat = swDoc.FirstFeature

    Do Until swFeat Is Nothing

        If swFeat.GetTypeName = "WeldmentTableFeat" Then

            Set swWeldmentCutListFeat = swFeat.GetSpecificFeature2

            vWeldmentCutListAnns = swWeldmentCutListFeat.GetTableAnnotations

            For Each vWeldmentCutListAnn In vWeldmentCutListAnns

                Set swWeldmentCutListAnn = vWeldmentCutListAnn

                Set swTableAnn = swWeldmentCutListAnn

                 'Get part doc associated with cut list and do something to it.

            Next

            CSVFile.Close

        End If

        Set swFeat = swFeat.GetNextFeature

    Loop

Outcomes