Message 1 of 4
Best way to add multiple iParts with different variations
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
I need to be able to add multiple versions of the same iPart in the same assembly file.
I have many holes which can be either true/false. they have around 10 different variations for the type of fitting that can be fit into them.
ie.
Hole 1 = True, and is 1"
meaning I need the 1" row of the iPart
Hole 2 = True, and is 1.5"
meaning I need the 1.5" row of the iPart
etc..
This is what I have so far, but just for inserting one iPart and changing its row. I don't know how best to carry on with this for multiple instances of the same iPart.
Sub Main() 'creating a list of options for iPart 1 Dim iPartList As New ArrayList() iPartList.Add("Option A") iPartList.Add("Option B") 'defining which multi value parameter(s) should use the above list MultiValue.List("iPART_SELECT") = iPartList If iPART = True Then Call Add_iPart Call Row_Select End If Call Delete_iPart End Sub Sub Add_iPart () Dim componentA = Components.AddiPart("First iPart:1", "iPart Test.ipt", row := 1, position := Nothing, grounded := False, visible := True, appearance := Nothing) End Sub Sub Row_Select() If iPART_SELECT = "Option A" Then iPart.ChangeRow("First iPart:1", "Row A") ElseIf iPART_SELECT = "Option B" Then iPart.ChangeRow("First iPart:1", "Row B") End If End Sub Sub Delete_iPart() If iPART = False Then Components.Delete("First iPart:1") End If End Sub
Thanks