9 Replies Latest reply on Jan 19, 2017 2:48 PM by Raghvendra Bhargava

    Weld table Hide

    Hrituc Alexandru



      How can hide the weld table with API?

      It's possible something like this?


      If swTable.Type = 0 Then

      table hide





        • Re: Weld table Hide
          Hrituc Alexandru

          In SolidWorks 2014, there is a bug on weld table when is inserted with API and I reported it and it's resolved in subsequent versions.

          • Re: Weld table Hide
            Raghvendra Bhargava

            Try and Explore this  swApp.RunCommand swCommands_Hide_Table, Empty

            May Help you.

              • Re: Weld table Hide
                Deepak Gupta

                But how to get the weld table without pre-selecting it?

                  • Re: Weld table Hide
                    Raghvendra Bhargava

                    Open any Drawing File which is having Weld Table and Run this Code. It should hide all the Weld Table .. ..Cheers..



                    Dim swApp As Object

                    Dim Part As ModelDoc2

                    Dim boolstatus As Boolean

                    Dim featureMgr As FeatureManager

                    Dim rootNode As TreeControlItem

                    Dim swFirstNode As TreeControlItem

                    Dim swNode As TreeControlItem

                    Dim swChildNode As TreeControlItem

                    Dim longstatus As Long, longwarnings As Long



                    Sub main()

                    Set swApp = Application.SldWorks

                    Set Part = swApp.ActiveDoc

                    Set featureMgr = Part.FeatureManager

                    Set rootNode = featureMgr.GetFeatureTreeRootItem2(swFeatMgrPaneTop)


                    If Not rootNode Is Nothing Then

                    Set swNode = rootNode.GetFirstChild

                        While Not swNode Is Nothing

                            Set swFirstNode = swNode.GetFirstChild

                            While Not swFirstNode Is Nothing

                                Set swChildNode = swFirstNode


                                    Dim WeldObj As Object

                                    Set WeldObj = swChildNode.Object


                                    If Not WeldObj Is Nothing Then

                                        Dim feat As feature

                                        Set feat = WeldObj


                                        If feat.GetTypeName2 = "WeldTableFeat" Then 'Getting Weld Table


                                        boolstatus = feat.Select2(False, -1) '>>Selecting Weld Table

                                        swApp.RunCommand swCommands_Hide_Table, Empty


                                        End If

                                    End If


                                Set swFirstNode = swFirstNode.GetNext


                            Set swNode = swNode.GetNext


                    End If


                    End Sub