13 Replies Latest reply on Mar 26, 2018 7:08 AM by Joe Cann

    Set all views to 'link balloon text to specified table'

    Checkcheck Master

      Is it possible to do this for multiple or all views instead of clicking all views apart ?

       

      Greetings !

        • Re: Set all views to 'link balloon text to specified table'
          Roderik Vreeke

          I've got the same problem.

          When I sort the BOM, the balloons of some views are not changing with the item numbers.

          I have to turn on "Link balloon text to specified table" for every view.

          This is annoying and causes errors.

          I recon that there must be an option to set this option on for all views.

          Does this option exist?

          • Re: Set all views to 'link balloon text to specified table'
            Alan Woolston

            I have the same problem. None of the veiws are EVER linked to the weldment cut list, every one has to be set manually.

             

            Hey Solidworks, pull your finger out and fix this. I see multiple posts about this going back to 2008 and no solution.

            • Re: Set all views to 'link balloon text to specified table'
              Roderik Vreeke

              Same problem!

              When does the hurting stops?

              • Re: Set all views to 'link balloon text to specified table'
                Anthony Macke

                this existing thread contains a macro to link all drawing views to their corresponding bom.

                 

                ive been using it for a while now with no problems at all.

                 

                https://forum.solidworks.com/message/125802#125802

                 

                 

                 

                here is the macro:

                 

                 

                Dim swApp As SldWorks.SldWorks
                Private Const strApp As String = "Link2BOM v1.00"

                Public Sub subMain()
                    Dim iCnt, iTotal As Integer
                    Dim retVal As Variant
                    Dim sBOMname As String
                    Dim vSheetNames As Variant
                   
                    Dim swView As SldWorks.View
                    Dim swSheetView As SldWorks.View
                    Dim swModel As SldWorks.ModelDoc2
                    Dim swDrawing As SldWorks.DrawingDoc
                    Dim swFeat As SldWorks.Feature
                    Dim swBOM As SldWorks.Feature
                   
                    Set swApp = Application.SldWorks
                    Set swModel = swApp.ActiveDoc
                    Set swDrawing = swModel
                    Set swFeat = swModel.FirstFeature
                   
                    'Get BOM name
                    Do While Not swFeat Is Nothing
                        If "BomFeat" = swFeat.GetTypeName Then
                            Set swBomFeat = swFeat.GetSpecificFeature2
                            Set swBOM = swBomFeat.GetFeature
                            sBOMname = swBOM.Name
                            Exit Do
                        End If
                        Set swFeat = swFeat.GetNextFeature
                    Loop
                   
                    vSheetNames = swDrawing.GetSheetNames
                    iTotal = UBound(vSheetNames) + 1
                    iCnt = 0

                    Do While iCnt < iTotal
                        'Set view linked to BOM
                        retVal = swDrawing.ActivateSheet(vSheetNames(iCnt))
                        Set swSheetView = swDrawing.GetFirstView
                        Set swView = swSheetView.GetNextView
                        Do While Not swView Is Nothing
                            retVal = swView.SetKeepLinkedToBOM(True, sBOMname)
                            Set swView = swView.GetNextView
                        Loop
                        iCnt = iCnt + 1
                    Loop

                    retVal = swDrawing.ActivateSheet(vSheetNames(0))
                   
                    swApp.SendMsgToUser2 "       Linking is complete...       ", swMbInformation, swMbOk

                    Set swApp = Nothing
                    Set swModel = Nothing
                    Set swDrawing = Nothing
                    Set swFeat = Nothing
                    Set swBomFeat = Nothing
                    Set swBOM = Nothing
                    Set swSheetView = Nothing
                    Set swView = Nothing
                   
                    End
                End Sub

                  • Re: Set all views to 'link balloon text to specified table'
                    Checkcheck Master

                    Nice macro Anthony, thanks !

                     

                    I've added a simple 'No document loaded' and 'Only for drawings' message.

                     

                     

                    Greetings !

                     

                     

                     

                    Dim swApp As SldWorks.SldWorks

                    Private Const strApp As String = "Link2BOM v1.00"

                     

                    Public Sub subMain()

                        Dim iCnt, iTotal As Integer

                        Dim retVal As Variant

                        Dim sBOMname As String

                        Dim vSheetNames As Variant

                      

                        Dim swView As SldWorks.View

                        Dim swSheetView As SldWorks.View

                        Dim swModel As SldWorks.ModelDoc2

                        Dim swDrawing As SldWorks.DrawingDoc

                        Dim swFeat As SldWorks.Feature

                        Dim swBOM As SldWorks.Feature

                      

                        Set swApp = Application.SldWorks

                        Set swModel = swApp.ActiveDoc

                              

                        ' No document loaded error handler

                        If swModel Is Nothing Then

                            MsgBox "No document loaded !", vbCritical

                            End

                        ElseIf Not swModel.GetType = 3 Then 'When no Drawing

                            MsgBox "This macro is only for a drawing !", vbCritical

                            End

                        End If

                           

                        Set swDrawing = swModel

                        Set swFeat = swModel.FirstFeature

                           

                        'Get BOM name

                        Do While Not swFeat Is Nothing

                            If "BomFeat" = swFeat.GetTypeName Then

                                Set swBomFeat = swFeat.GetSpecificFeature2

                                Set swBOM = swBomFeat.GetFeature

                                sBOMname = swBOM.Name

                                Exit Do

                            End If

                            Set swFeat = swFeat.GetNextFeature

                        Loop

                      

                        vSheetNames = swDrawing.GetSheetNames

                        iTotal = UBound(vSheetNames) + 1

                        iCnt = 0

                     

                        Do While iCnt < iTotal

                            'Set view linked to BOM

                            retVal = swDrawing.ActivateSheet(vSheetNames(iCnt))

                            Set swSheetView = swDrawing.GetFirstView

                            Set swView = swSheetView.GetNextView

                            Do While Not swView Is Nothing

                                retVal = swView.SetKeepLinkedToBOM(True, sBOMname)

                                Set swView = swView.GetNextView

                            Loop

                            iCnt = iCnt + 1

                        Loop

                     

                        retVal = swDrawing.ActivateSheet(vSheetNames(0))

                      

                        swApp.SendMsgToUser2 "       Linking is complete...       ", swMbInformation, swMbOk

                     

                        Set swApp = Nothing

                        Set swModel = Nothing

                        Set swDrawing = Nothing

                        Set swFeat = Nothing

                        Set swBomFeat = Nothing

                        Set swBOM = Nothing

                        Set swSheetView = Nothing

                        Set swView = Nothing

                      

                        End

                    End Sub

                  • Re: Set all views to 'link balloon text to specified table'
                    Brian Marks

                    Ok that looks like a great Band-Aid but has it been fixed by SolidWorks yet.

                    • Re: Set all views to 'link balloon text to specified table'
                      Joe Cann

                      Thank you to everyone who contributed to this post. I've got a drawing here with 63 individual views, only a handful are linked to the bom, it was taking about 2 minutes per view to think about the change when I clicked the 'link balloon text...' check box. This macro has saved me about 2 hours of just staring at my screen!