vbasolidworks

Solidworks Weldment Profile Configuration Selecting


I want to use tube templates in my assembly. I configured a .sldlfp file in my weldment templates.

I can configure height of part but not tube size. I have a userform for entering height and selecting tube size.

Should I use IStructuralMemberFeatureData?

Here is the combobox I have same name in my weldment templates.

Private Sub UserForm_Initialize()
Me.ComboBox1.AddItem "DN15"
Me.ComboBox1.AddItem "DN20"
Me.ComboBox1.AddItem "DN25"
Me.ComboBox1.AddItem "DN32"
Me.ComboBox1.AddItem "DN40"
Me.ComboBox1.AddItem "DN50"
Me.ComboBox1.AddItem "DN65"
Me.ComboBox1.AddItem "DN80"
End Sub

Solution

  • I did it with multiple tube templates    

    With Me.ComboBox1
                .AddItem "1/2''   Çap 21,3 DN15"
                .AddItem "3/4''   Çap 26,9 DN20"
                .AddItem "1''     Çap 33,7 DN25"
            End With
        
        If ComboBox1.ListIndex = 0 Then
            Dim Weldment As String
            Weldment = "C:\Program Files\SOLIDWORKS Corp\SOLIDWORKS\lang\turkish\weldment profiles\iso\pipe\21.3 x 2.3.sldlfp"
        ElseIf ComboBox1.ListIndex = 1 Then
            Weldment = "C:\Program Files\SOLIDWORKS Corp\SOLIDWORKS\lang\turkish\weldment profiles\iso\pipe\26.9 x 3.2.sldlfp"
        ElseIf ComboBox1.ListIndex = 2 Then
            Weldment = "C:\Program Files\SOLIDWORKS Corp\SOLIDWORKS\lang\turkish\weldment profiles\iso\pipe\33.7 x 4.0.sldlfp"
        End If
        Set myFeature = swModel.FeatureManager.InsertStructuralWeldment4(Weldment, 1, True, (vGroups))