
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Hi,
I have this assembly where I have several components that I want to replace. I am using a multivalue.setlist for coding. It does work, but I was wondering if there is a better shorter way coding to accomplish the same task? is there a way to share the list since the list is the same for all components? Also I will be adding more components to the list in the future the components location will always be the same just the file name will change. So it would be nice is if I add a new component name to the list it will update and be able to replace the new component with the value I just added without me having to pinpoint where the file is. I just want to find a better way to code this since I will be updating the coding everyso often and the coding already is very long. I am attaching my form and my coding I just added code for two device 1, and device 2 . I still need to add coding for device 3-5. Let me know if you have any ideas. Thank you
MultiValue.SetList("Device1PN","EXP-PB-004-B", "EXP-PB-004-G", "EXP-PB-004-MH", "EXP-PB-004-R","EXP-PB-004-R-1",
"EXP-PB-005-B","EXP-PB-005-G", "EXP-PB-005-G-1", "EXP-PB-005-MH-R", "EXP-PB-005-MH-R-01", "EXP-PB-005-MH-R-1", "EXP-PB-005-R", "EXP-PB-005-R-1",
"EXP-PL-002-R", "EXP-PL-003-A", "EXP-PL-003-A024", "EXP-PL-003-A240","EXP-PL-003-G","EXP-PL-003-G024","EXP-PL-003-G240","EXP-PL-003-R",
"EXP-PL-003-R024","EXP-PL-003-R24","EXP-PL-003-R240","EXP-PL-003-W","EXP-PL-003-W024","EXP-PL-003-W240",
"EXP-REP-10K0201","EXP-SEL-2POS-02","EXP-SEL-2POS-03","EXP-SEL-2POS-04","EXP-SEL-3POS-01","EXP-SEL-3POS-02","EXP-SW-001","EXP-SW-002" )
If Device1used=True Then
Select Case Device1PN
Case "EXP-PB-004-B"
Component.Replace("DEVICE1", "C:\NEEL\Libraries\Purchased Parts\E\EXP-PB-004-B.ipt", False)
Case "EXP-PB-004-G"
Component.Replace("DEVICE1", "C:\NEEL\Libraries\Purchased Parts\E\EXP-PB-004-G.ipt", False)
Case "EXP-PB-004-MH"
Component.Replace("DEVICE1", "C:\NEEL\Libraries\Purchased Parts\E\EXP-DEVICE-003.ipt", False)
Case "EXP-PB-004-R"
Component.Replace("DEVICE1", "C:\NEEL\Libraries\Purchased Parts\E\EXP-PB-004-R.ipt", False)
Case "EXP-PB-004-R-1"
Component.Replace("DEVICE1", "C:\NEEL\Libraries\Purchased Parts\E\EXP-PB-004-R-1.ipt", False)
Case "EXP-PB-005-B"
Component.Replace("DEVICE1", "C:\NEEL\Libraries\Purchased Parts\E\EXP-PB-005-B.ipt", False)
Case "EXP-PB-005-G"
Component.Replace("DEVICE1", "C:\NEEL\Libraries\Purchased Parts\E\EXP-PB-005-G.ipt", False)
Case "EXP-PB-005-G-1"
Component.Replace("DEVICE1", "C:\NEEL\Libraries\Purchased Parts\E\EXP-PB-005-G-1.ipt", False)
Case "EXP-PB-005-MH-R"
Component.Replace("DEVICE1", "C:\NEEL\Libraries\Purchased Parts\E\EXP-PB-005-MH-R.ipt", False)
Case "EXP-PB-005-MH-R-1"
Component.Replace("DEVICE1", "C:\NEEL\Libraries\Purchased Parts\E\EXP-PB-005-MH-R-1.ipt", False)
Case "EXP-PB-005-R"
Component.Replace("DEVICE1", "C:\NEEL\Libraries\Purchased Parts\E\EXP-PB-005-R.ipt", False)
Case "EXP-PB-005-R-1"
Component.Replace("DEVICE1", "C:\NEEL\Libraries\Purchased Parts\E\EXP-PB-005-R-1.ipt", False)
Case "EXP-PL-002-R"
Component.Replace("DEVICE1", "C:\NEEL\Libraries\Purchased Parts\E\EXP-PL-002-R.ipt", False)
Case "EXP-PL-003-A"
Component.Replace("DEVICE1", "C:\NEEL\Libraries\Purchased Parts\E\EXP-PL-003-A.ipt", False)
Case "EXP-PL-003-R240"
Component.Replace("DEVICE1", "C:\NEEL\Libraries\Purchased Parts\E\EXP-PL-003-R240.ipt", False)
Case "EXP-PL-003-W"
Component.Replace("DEVICE1", "C:\NEEL\Libraries\Purchased Parts\E\EXP-PL-003-W.ipt", False)
Case "EXP-PL-003-W024"
Component.Replace("DEVICE1", "C:\NEEL\Libraries\Purchased Parts\E\EXP-PL-003-W024.ipt", False)
Case "EXP-PL-003-W240"
Component.Replace("DEVICE1", "C:\NEEL\Libraries\Purchased Parts\E\EXP-PL-003-W240.ipt", False)
End Select
End If
MultiValue.SetList("Device2PN","EXP-PB-004-B", "EXP-PB-004-G", "EXP-PB-004-MH", "EXP-PB-004-R","EXP-PB-004-R-1",
"EXP-PB-005-B","EXP-PB-005-G", "EXP-PB-005-G-1", "EXP-PB-005-MH-R", "EXP-PB-005-MH-R-01", "EXP-PB-005-MH-R-1", "EXP-PB-005-R", "EXP-PB-005-R-1",
"EXP-PL-002-R", "EXP-PL-003-A", "EXP-PL-003-A024", "EXP-PL-003-A240","EXP-PL-003-G","EXP-PL-003-G024","EXP-PL-003-G240","EXP-PL-003-R",
"EXP-PL-003-R024","EXP-PL-003-R24","EXP-PL-003-R240","EXP-PL-003-W","EXP-PL-003-W024","EXP-PL-003-W240",
"EXP-REP-10K0201","EXP-SEL-2POS-02","EXP-SEL-2POS-03","EXP-SEL-2POS-04","EXP-SEL-3POS-01","EXP-SEL-3POS-02","EXP-SW-001","EXP-SW-002" )
If Device2used=True Then
Select Case Device2PN
Case "EXP-PB-004-B"
Component.Replace("DEVICE2", "C:\NEEL\Libraries\Purchased Parts\E\EXP-PB-004-B.ipt", False)
Case "EXP-PB-004-G"
Component.Replace("DEVICE2", "C:\NEEL\Libraries\Purchased Parts\E\EXP-PB-004-G.ipt", False)
Case "EXP-PB-004-MH"
Component.Replace("DEVICE2", "C:\NEEL\Libraries\Purchased Parts\E\EXP-DEVICE-003.ipt", False)
Case "EXP-PB-004-R"
Component.Replace("DEVICE2", "C:\NEEL\Libraries\Purchased Parts\E\EXP-PB-004-R.ipt", False)
Case "EXP-PB-004-R-1"
Component.Replace("DEVICE2", "C:\NEEL\Libraries\Purchased Parts\E\EXP-PB-004-R-1.ipt", False)
Case "EXP-PB-005-B"
Component.Replace("DEVICE2", "C:\NEEL\Libraries\Purchased Parts\E\EXP-PB-005-B.ipt", False)
Case "EXP-PB-005-G"
Component.Replace("DEVICE2", "C:\NEEL\Libraries\Purchased Parts\E\EXP-PB-005-G.ipt", False)
Case "EXP-PB-005-G-1"
Component.Replace("DEVICE2", "C:\NEEL\Libraries\Purchased Parts\E\EXP-PB-005-G-1.ipt", False)
Case "EXP-PB-005-MH-R"
Component.Replace("DEVICE2", "C:\NEEL\Libraries\Purchased Parts\E\EXP-PB-005-MH-R.ipt", False)
Case "EXP-PB-005-MH-R-1"
Component.Replace("DEVICE2", "C:\NEEL\Libraries\Purchased Parts\E\EXP-PB-005-MH-R-1.ipt", False)
Case "EXP-PB-005-R"
Component.Replace("DEVICE2", "C:\NEEL\Libraries\Purchased Parts\E\EXP-PB-005-R.ipt", False)
Case "EXP-PB-005-R-1"
Component.Replace("DEVICE2", "C:\NEEL\Libraries\Purchased Parts\E\EXP-PB-005-R-1.ipt", False)
Case "EXP-PL-002-R"
Component.Replace("DEVICE2", "C:\NEEL\Libraries\Purchased Parts\E\EXP-PL-002-R.ipt", False)
Case "EXP-PL-003-A"
Component.Replace("DEVICE2", "C:\NEEL\Libraries\Purchased Parts\E\EXP-PL-003-A.ipt", False)
Case "EXP-PL-003-R240"
Component.Replace("DEVICE2", "C:\NEEL\Libraries\Purchased Parts\E\EXP-PL-003-R240.ipt", False)
Case "EXP-PL-003-W"
Component.Replace("DEVICE2", "C:\NEEL\Libraries\Purchased Parts\E\EXP-PL-003-W.ipt", False)
Case "EXP-PL-003-W024"
Component.Replace("DEVICE2", "C:\NEEL\Libraries\Purchased Parts\E\EXP-PL-003-W024.ipt", False)
Case "EXP-PL-003-W240"
Component.Replace("DEVICE2", "C:\NEEL\Libraries\Purchased Parts\E\EXP-PL-003-W240.ipt", False)
End Select
End If
Solved! Go to Solution.