AnsweredAssumed Answered

Simplifying a Massive if, elseif statement

Question asked by Kyle Thomson on Jun 25, 2020
Latest reply on Jun 26, 2020 by Scott Perman

Hello,

 

     I am trying to create a VBA code for assigning materials to an assembly that will later be analysed in simulation. Please note that I have only been using VBA for about a week or two and am at a very beginner level of learning from Youtube. As part of this interface, picking each parts material in the assembly is done through an Excel file. The Excel file has a double drop down selection, one for the category of material and one for final material. The VBA code reads the final material selection from excel for each piece. Currently, I have an if/ elseif section that goes through and looks for a match in VBA for every piece. I am looking for a way to make this just one section with either a nested for or if statement around it. There is a copy of one section of choosing a material of the code below to give an idea of what I am doing. I need to make it smaller due to having errors of exceeding the 64 kb limit if I run it on assemblies over 5 materials in my full code.  Finally, if you have any advise on how to create a new material using VBA that would be extremely helpful as well.

 

Thank you!!!

      Kyle

 

'******************************Set the Materials******************************************************

'Dim ActiveDocObj As Object
'Dim StudyManagerObj As Object
'Dim LoadsAndRestraintsManagerObj As Object
'Dim ErrorCodeObj As Long
'Dim ContactManagerObj As Object
'Set ActiveDocObj = COSMOSWORKSObj.ActiveDoc()
'Set StudyManagerObj = ActiveDocObj.StudyManager()
'Dim StudyObj As Object
'Set StudyObj = StudyManagerObj.GetStudy(0)
'Dim SolidManagerObj As Object
'Set SolidManagerObj = StudyObj.SolidManager()
'
'
'Dim ExcelApp As Excel.Application
'Set ExcelApp = CreateObject("Excel.Application")
'Dim WkBk As Excel.Workbook
'Dim firstmaterial As String
'Dim PartInputValue As String
''select part
'Set WkBk = ExcelApp.Workbooks.Open(FileName:="E:\LCDRIVES\Fie234.xlsx")
'PartInputValue = WkBk.Sheets(1).Range("G4").Value
'firstmaterial = WkBk.Sheets(1).Range("H6").Value
'If PartInputValue > 0 Then
' If firstmaterial = "1023CarbonSteelSheetSS" Then
' ErrorCodeObj = SolidManagerObj.SetLibraryMaterialToAllBodiesByCompName("222Block-1", "solidworks materials", "1023 Carbon Steel Sheet (SS)")
' ElseIf firstmaterial = "201AnnealedStainlessSteel" Then
' ErrorCodeObj = SolidManagerObj.SetLibraryMaterialToAllBodiesByCompName("222Block-1", "solidworks materials", "201 Annealed Stainless Steel (SS)")
' ElseIf firstmaterial = "A286IronBaseSuperalloy" Then
' ErrorCodeObj = SolidManagerObj.SetLibraryMaterialToAllBodiesByCompName("222Block-1", "solidworks materials", "A286 Iron Base Superalloy")
' ElseIf firstmaterial = "AISI1010SteelHotRolledBar" Then
' ErrorCodeObj = SolidManagerObj.SetLibraryMaterialToAllBodiesByCompName("222Block-1", "solidworks materials", "AISI 1010 Steel, hot rolled bar")
' ElseIf firstmaterial = "AISI1015SteelColdDrawnSS" Then
' ErrorCodeObj = SolidManagerObj.SetLibraryMaterialToAllBodiesByCompName("222Block-1", "solidworks materials", "AISI 1015 Steel, Cold Drawn (SS)")
' ElseIf firstmaterial = "AISI1020" Then
' ErrorCodeObj = SolidManagerObj.SetLibraryMaterialToAllBodiesByCompName("222Block-1", "solidworks materials", "AISI 1020")
' ElseIf firstmaterial = "AISI1020SteelColdRolled" Then
' ErrorCodeObj = SolidManagerObj.SetLibraryMaterialToAllBodiesByCompName("222Block-1", "solidworks materials", "AISI 1020 Steel, Cold Rolled")
' ElseIf firstmaterial = "AISI1035SteelSS" Then
' ErrorCodeObj = SolidManagerObj.SetLibraryMaterialToAllBodiesByCompName("222Block-1", "solidworks materials", "AISI 1035 Steel (SS)")
' ElseIf firstmaterial = "AISI1045SteelColdDrawn" Then
' ErrorCodeObj = SolidManagerObj.SetLibraryMaterialToAllBodiesByCompName("222Block-1", "solidworks materials", "AISI 1045 Steel, cold drawn")
' ElseIf firstmaterial = "AISI304" Then
' ErrorCodeObj = SolidManagerObj.SetLibraryMaterialToAllBodiesByCompName("222Block-1", "solidworks materials", "AISI 304")
' ElseIf firstmaterial = "AISI316AnnealedStainlessSteelBarSS" Then
' ErrorCodeObj = SolidManagerObj.SetLibraryMaterialToAllBodiesByCompName("222Block-1", "solidworks materials", "AISI 316 Annealed Stainless Steel Bar (SS)")
' ElseIf firstmaterial = "AISI316StainlessSteelSheetSS" Then
' ErrorCodeObj = SolidManagerObj.SetLibraryMaterialToAllBodiesByCompName("222Block-1", "solidworks materials", "AISI 316 Stainless Steel Sheet (SS)")
' ElseIf firstmaterial = "AISI321AnnealedStainlessSteelSS" Then
' ErrorCodeObj = SolidManagerObj.SetLibraryMaterialToAllBodiesByCompName("222Block-1", "solidworks materials", "AISI 321 Annealed Stainless Steel (SS)")
' ElseIf firstmaterial = "AISI347AnnealedStainlessSteelSS" Then
' ErrorCodeObj = SolidManagerObj.SetLibraryMaterialToAllBodiesByCompName("222Block-1", "solidworks materials", "AISI 347 Annealed Stainless Steel (SS)")
' ElseIf firstmaterial = "AISI4130SteelAnnealedat865C" Then
' ErrorCodeObj = SolidManagerObj.SetLibraryMaterialToAllBodiesByCompName("222Block-1", "solidworks materials", "AISI 4130 Steel, annealed at 865C")
' ElseIf firstmaterial = "AISI4130SteelNormalizedat870C" Then
' ErrorCodeObj = SolidManagerObj.SetLibraryMaterialToAllBodiesByCompName("222Block-1", "solidworks materials", "AISI 4130 Steel, normalized at 870C")
' ElseIf firstmaterial = "AISI4340SteelAnnealed" Then
' ErrorCodeObj = SolidManagerObj.SetLibraryMaterialToAllBodiesByCompName("222Block-1", "solidworks materials", "AISI 4340 Steel, annealed")
' ElseIf firstmaterial = "AISI4340SteelNormalized" Then
' ErrorCodeObj = SolidManagerObj.SetLibraryMaterialToAllBodiesByCompName("222Block-1", "solidworks materials", "AISI 4340 Steel, normalized")
' ElseIf firstmaterial = "AISIType316LStainlessSteel" Then
' ErrorCodeObj = SolidManagerObj.SetLibraryMaterialToAllBodiesByCompName("222Block-1", "solidworks materials", "AISI Type 316L stainless steel")
' ElseIf firstmaterial = "AlloySteel" Then
' ErrorCodeObj = SolidManagerObj.SetLibraryMaterialToAllBodiesByCompName("222Block-1", "solidworks materials", "Alloy Steel")
' ElseIf firstmaterial = "AlloySteelSS" Then
' ErrorCodeObj = SolidManagerObj.SetLibraryMaterialToAllBodiesByCompName("222Block-1", "solidworks materials", "Alloy Steel (SS)")
' ElseIf firstmaterial = "CastAlloySteel" Then
' ErrorCodeObj = SolidManagerObj.SetLibraryMaterialToAllBodiesByCompName("222Block-1", "solidworks materials", "Cast Alloy Steel")
' ElseIf firstmaterial = "CastCarbonSteel" Then
' ErrorCodeObj = SolidManagerObj.SetLibraryMaterialToAllBodiesByCompName("222Block-1", "solidworks materials", "Cast Carbon Steel")
' ElseIf firstmaterial = "CastStainlessSteel" Then
' ErrorCodeObj = SolidManagerObj.SetLibraryMaterialToAllBodiesByCompName("222Block-1", "solidworks materials", "Cast Stainless Steel")
' ElseIf firstmaterial = "ChromeStainlessSteel" Then
' ErrorCodeObj = SolidManagerObj.SetLibraryMaterialToAllBodiesByCompName("222Block-1", "solidworks materials", "Chrome Stainless Steel")
' ElseIf firstmaterial = "PlainCarbonSteel" Then
' ErrorCodeObj = SolidManagerObj.SetLibraryMaterialToAllBodiesByCompName("222Block-1", "solidworks materials", "Plain Carbon Steel")
' ElseIf firstmaterial = "StainlessSteelferritic" Then
' ErrorCodeObj = SolidManagerObj.SetLibraryMaterialToAllBodiesByCompName("222Block-1", "solidworks materials", "Stainless Steel (ferritic)")
' ElseIf firstmaterial = "WroughtStainlessSteel" Then
' ErrorCodeObj = SolidManagerObj.SetLibraryMaterialToAllBodiesByCompName("222Block-1", "solidworks materials", "Wrought Stainless Steel")
' ElseIf firstmaterial = "DuctileIron" Then
' ErrorCodeObj = SolidManagerObj.SetLibraryMaterialToAllBodiesByCompName("222Block-1", "solidworks materials", "Ductile Iron")
' ElseIf firstmaterial = "DuctileironSN" Then
' ErrorCodeObj = SolidManagerObj.SetLibraryMaterialToAllBodiesByCompName("222Block-1", "solidworks materials", "Ductile Iron (SN)")
' ElseIf firstmaterial = "GrayCastIron" Then
' ErrorCodeObj = SolidManagerObj.SetLibraryMaterialToAllBodiesByCompName("222Block-1", "solidworks materials", "Gray Cast Iron")
' ElseIf firstmaterial = "GrayCastIronSN" Then
' ErrorCodeObj = SolidManagerObj.SetLibraryMaterialToAllBodiesByCompName("222Block-1", "solidworks materials", "Gray Cast Iron (SN)")
' ElseIf firstmaterial = "MalleableCastIron" Then
' ErrorCodeObj = SolidManagerObj.SetFavLibraryMaterialToAllBodiesByCompName("222Block-1", "solidworks materials", "Malleable Cast Iron")
' ElseIf firstmaterial = "1060Alloy" Then
' ErrorCodeObj = SolidManagerObj.SetFavLibraryMaterialToAllBodiesByCompName("222Block-1", "solidworks materials", "1060 Alloy")
' ElseIf firstmaterial = "1060H12" Then
' ErrorCodeObj = SolidManagerObj.SetLibraryMaterialToAllBodiesByCompName("222Block-1", "solidworks materials", "1060-H12")
' ElseIf firstmaterial = "1060H12RodSS" Then
' ErrorCodeObj = SolidManagerObj.SetLibraryMaterialToAllBodiesByCompName("222Block-1", "solidworks materials", "1060-H12 Rod (SS)")
' ElseIf firstmaterial = "1060H14" Then
' ErrorCodeObj = SolidManagerObj.SetLibraryMaterialToAllBodiesByCompName("222Block-1", "solidworks materials", "1060-H14")
' ElseIf firstmaterial = "1060H16" Then
' ErrorCodeObj = SolidManagerObj.SetLibraryMaterialToAllBodiesByCompName("222Block-1", "solidworks materials", "1060-H16")
' ElseIf firstmaterial = "1060H18" Then
' ErrorCodeObj = SolidManagerObj.SetLibraryMaterialToAllBodiesByCompName("222Block-1", "solidworks materials", "1060-H18")
' ElseIf firstmaterial = "1060H18RodSS1060OSS" Then
' ErrorCodeObj = SolidManagerObj.SetLibraryMaterialToAllBodiesByCompName("222Block-1", "solidworks materials", "1060-H18 Rod (SS)")
' ElseIf firstmaterial = "1100H12RodSS" Then
' ErrorCodeObj = SolidManagerObj.SetLibraryMaterialToAllBodiesByCompName("222Block-1", "solidworks materials", "1100-H12 Rod (SS)")
' ElseIf firstmaterial = "1100H16RodSS" Then
' ErrorCodeObj = SolidManagerObj.SetLibraryMaterialToAllBodiesByCompName("222Block-1", "solidworks materials", "1100-H16 Rod (SS)")
' ElseIf firstmaterial = "1100H26RodSS" Then
' ErrorCodeObj = SolidManagerObj.SetLibraryMaterialToAllBodiesByCompName("222Block-1", "solidworks materials", "1100-H26 Rod (SS)")
' ElseIf firstmaterial = "1100ORodSS" Then
' ErrorCodeObj = SolidManagerObj.SetLibraryMaterialToAllBodiesByCompName("222Block-1", "solidworks materials", "1100-O Rod (SS)")
' ElseIf firstmaterial = "1345Alloy" Then
' ErrorCodeObj = SolidManagerObj.SetLibraryMaterialToAllBodiesByCompName("222Block-1", "solidworks materials", "1345 Alloy")
' ElseIf firstmaterial = "1350Alloy" Then
' ErrorCodeObj = SolidManagerObj.SetLibraryMaterialToAllBodiesByCompName("222Block-1", "solidworks materials", "1350 Alloy")
' ElseIf firstmaterial = "201T43InsulatedMoldCastingSS" Then
' ErrorCodeObj = SolidManagerObj.SetLibraryMaterialToAllBodiesByCompName("222Block-1", "solidworks materials", "201.0-T43 Insulated Mold Casting (SS)")
' ElseIf firstmaterial = "201T6InsulatedMoldCastingSS" Then
' ErrorCodeObj = SolidManagerObj.SetLibraryMaterialToAllBodiesByCompName("222Block-1", "solidworks materials", "201.0-T6 Insulated Mold Casting (SS)")
' ElseIf firstmaterial = "201T7InsulatedMoldCastingSS" Then
' ErrorCodeObj = SolidManagerObj.SetLibraryMaterialToAllBodiesByCompName("222Block-1", "solidworks materials", "201.0-T7 Insulated Mold Casting (SS)")
' ElseIf firstmaterial = "2014Alloy" Then
' ErrorCodeObj = SolidManagerObj.SetLibraryMaterialToAllBodiesByCompName("222Block-1", "solidworks materials", "2014 Alloy")
' ElseIf firstmaterial = "2014O" Then
' ErrorCodeObj = SolidManagerObj.SetLibraryMaterialToAllBodiesByCompName("222Block-1", "solidworks materials", "2014-O")
' ElseIf firstmaterial = "2014T4" Then
' ErrorCodeObj = SolidManagerObj.SetLibraryMaterialToAllBodiesByCompName("222Block-1", "solidworks materials", "2014-T4")
' ElseIf firstmaterial = "2014T6" Then
' ErrorCodeObj = SolidManagerObj.SetLibraryMaterialToAllBodiesByCompName("222Block-1", "solidworks materials", "2014-T6")
' ElseIf firstmaterial = "2018Alloy" Then
' ErrorCodeObj = SolidManagerObj.SetLibraryMaterialToAllBodiesByCompName("222Block-1", "solidworks materials", "2018 Alloy")
' ElseIf firstmaterial = "2024Alloy" Then
' ErrorCodeObj = SolidManagerObj.SetLibraryMaterialToAllBodiesByCompName("222Block-1", "solidworks materials", "2024 Alloy")
' ElseIf firstmaterial = "2024AlloySN" Then
' ErrorCodeObj = SolidManagerObj.SetLibraryMaterialToAllBodiesByCompName("222Block-1", "solidworks materials", "2024 Alloy (SN)")
' ElseIf firstmaterial = "2024O" Then
' ErrorCodeObj = SolidManagerObj.SetLibraryMaterialToAllBodiesByCompName("222Block-1", "solidworks materials", "2024-O")
' ElseIf firstmaterial = "204T3" Then
' ErrorCodeObj = SolidManagerObj.SetLibraryMaterialToAllBodiesByCompName("222Block-1", "solidworks materials", "2024-T3")
' ElseIf firstmaterial = "2024T361" Then
' ErrorCodeObj = SolidManagerObj.SetLibraryMaterialToAllBodiesByCompName("222Block-1", "solidworks materials", "2024-T361")
' ElseIf firstmaterial = "2024T4" Then
' ErrorCodeObj = SolidManagerObj.SetLibraryMaterialToAllBodiesByCompName("222Block-1", "solidworks materials", "2024-T4")
' ElseIf firstmaterial = "2219O" Then
' ErrorCodeObj = SolidManagerObj.SetLibraryMaterialToAllBodiesByCompName("222Block-1", "solidworks materials", "2219-O")
' ElseIf firstmaterial = "2219T31" Then
' ErrorCodeObj = SolidManagerObj.SetLibraryMaterialToAllBodiesByCompName("222Block-1", "solidworks materials", "2219-T31")
' ElseIf firstmaterial = "2219T37" Then
' ErrorCodeObj = SolidManagerObj.SetLibraryMaterialToAllBodiesByCompName("222Block-1", "solidworks materials", "2219-T37")
' ElseIf firstmaterial = "2219T62" Then
' ErrorCodeObj = SolidManagerObj.SetLibraryMaterialToAllBodiesByCompName("222Block-1", "solidworks materials", "2219-T62")
' ElseIf firstmaterial = "2219T81" Then
' ErrorCodeObj = SolidManagerObj.SetLibraryMaterialToAllBodiesByCompName("222Block-1", "solidworks materials", "2219-T81")
' ElseIf firstmaterial = "2219T87" Then
' ErrorCodeObj = SolidManagerObj.SetLibraryMaterialToAllBodiesByCompName("222Block-1", "solidworks materials", "2219-T87")
' ElseIf firstmaterial = "2618T61SS" Then
' ErrorCodeObj = SolidManagerObj.SetLibraryMaterialToAllBodiesByCompName("222Block-1", "solidworks materials", "2618-T61 (SS)")
' ElseIf firstmaterial = "3003Alloy" Then
' ErrorCodeObj = SolidManagerObj.SetLibraryMaterialToAllBodiesByCompName("222Block-1", "solidworks materials", "3003 Alloy")
' ElseIf firstmaterial = "3003H12" Then
' ErrorCodeObj = SolidManagerObj.SetLibraryMaterialToAllBodiesByCompName("222Block-1", "solidworks materials", "3003-H12")
' ElseIf firstmaterial = "3003H12RodSS" Then
' ErrorCodeObj = SolidManagerObj.SetLibraryMaterialToAllBodiesByCompName("222Block-1", "solidworks materials", "3003-H12, Rod (SS)")
' ElseIf firstmaterial = "3003H14" Then
' ErrorCodeObj = SolidManagerObj.SetLibraryMaterialToAllBodiesByCompName("222Block-1", "solidworks materials", "3003-H14")
' ElseIf firstmaterial = "3003H14RodSS" Then
' ErrorCodeObj = SolidManagerObj.SetLibraryMaterialToAllBodiesByCompName("222Block-1", "solidworks materials", "3003-H14, Rod (SS)")
' ElseIf firstmaterial = "3003H16" Then
' ErrorCodeObj = SolidManagerObj.SetLibraryMaterialToAllBodiesByCompName("222Block-1", "solidworks materials", "3003-H16")
' ElseIf firstmaterial = "3003H18" Then
' ErrorCodeObj = SolidManagerObj.SetLibraryMaterialToAllBodiesByCompName("222Block-1", "solidworks materials", "3003-H18")
' ElseIf firstmaterial = "3003H18RodSS" Then
' ErrorCodeObj = SolidManagerObj.SetLibraryMaterialToAllBodiesByCompName("222Block-1", "solidworks materials", "3003-H18, Rod (SS)")
' ElseIf firstmaterial = "3003O" Then
' ErrorCodeObj = SolidManagerObj.SetLibraryMaterialToAllBodiesByCompName("222Block-1", "solidworks materials", "3003-O")
' ElseIf firstmaterial = "3003ORodSS" Then
' ErrorCodeObj = SolidManagerObj.SetLibraryMaterialToAllBodiesByCompName("222Block-1", "solidworks materials", "3003-O, Rod (SS)")
' ElseIf firstmaterial = "3004H34RodSS" Then
' ErrorCodeObj = SolidManagerObj.SetLibraryMaterialToAllBodiesByCompName("222Block-1", "solidworks materials", "3004-H34, Rod (SS)")
' ElseIf firstmaterial = "3004ORodSS" Then
' ErrorCodeObj = SolidManagerObj.SetLibraryMaterialToAllBodiesByCompName("222Block-1", "solidworks materials", "3004-O, Rod (SS)")
' ElseIf firstmaterial = "356T6PermanentMoldCastSS" Then
' ErrorCodeObj = SolidManagerObj.SetLibraryMaterialToAllBodiesByCompName("222Block-1", "solidworks materials", "356.0-T6 Permanent Mold cast (SS)")
' ElseIf firstmaterial = "4032T6" Then
' ErrorCodeObj = SolidManagerObj.SetLibraryMaterialToAllBodiesByCompName("222Block-1", "solidworks materials", "4032-T6")
' ElseIf firstmaterial = "5052H32" Then
' ErrorCodeObj = SolidManagerObj.SetLibraryMaterialToAllBodiesByCompName("222Block-1", "solidworks materials", "5052-H32")
' ElseIf firstmaterial = "5052H34" Then
' ErrorCodeObj = SolidManagerObj.SetLibraryMaterialToAllBodiesByCompName("222Block-1", "solidworks materials", "5052-H34")
' ElseIf firstmaterial = "5052H36" Then
' ErrorCodeObj = SolidManagerObj.SetLibraryMaterialToAllBodiesByCompName("222Block-1", "solidworks materials", "5052-H36")
' ElseIf firstmaterial = "5052H38" Then
' ErrorCodeObj = SolidManagerObj.SetLibraryMaterialToAllBodiesByCompName("222Block-1", "solidworks materials", "5052-H38")
' ElseIf firstmaterial = "5052H38RodSS" Then
' ErrorCodeObj = SolidManagerObj.SetLibraryMaterialToAllBodiesByCompName("222Block-1", "solidworks materials", "5052-H38, Rod (SS)")
' ElseIf firstmaterial = "5052O" Then
' ErrorCodeObj = SolidManagerObj.SetLibraryMaterialToAllBodiesByCompName("222Block-1", "solidworks materials", "5052-O")
' ElseIf firstmaterial = "5052ORodSS" Then
' ErrorCodeObj = SolidManagerObj.SetLibraryMaterialToAllBodiesByCompName("222Block-1", "solidworks materials", "5052-O, Rod (SS)")
' ElseIf firstmaterial = "5086H32RodSS" Then
' ErrorCodeObj = SolidManagerObj.SetLibraryMaterialToAllBodiesByCompName("222Block-1", "solidworks materials", "5086-H32, Rod (SS)")
' ElseIf firstmaterial = "5154ORodSS" Then
' ErrorCodeObj = SolidManagerObj.SetLibraryMaterialToAllBodiesByCompName("222Block-1", "solidworks materials", "5154-O, Rod (SS)")
' ElseIf firstmaterial = "5454H111" Then
' ErrorCodeObj = SolidManagerObj.SetLibraryMaterialToAllBodiesByCompName("222Block-1", "solidworks materials", "5454-H111")
' ElseIf firstmaterial = "5454H112" Then
' ErrorCodeObj = SolidManagerObj.SetLibraryMaterialToAllBodiesByCompName("222Block-1", "solidworks materials", "5454-H112")
' ElseIf firstmaterial = "5454H32" Then
' ErrorCodeObj = SolidManagerObj.SetLibraryMaterialToAllBodiesByCompName("222Block-1", "solidworks materials", "5454-H32")
' ElseIf firstmaterial = "5454H34" Then
' ErrorCodeObj = SolidManagerObj.SetLibraryMaterialToAllBodiesByCompName("222Block-1", "solidworks materials", "5454-H34")
' ElseIf firstmaterial = "5454O" Then
' ErrorCodeObj = SolidManagerObj.SetLibraryMaterialToAllBodiesByCompName("222Block-1", "solidworks materials", "5454-O")
' ElseIf firstmaterial = "6061Alloy" Then
' ErrorCodeObj = SolidManagerObj.SetLibraryMaterialToAllBodiesByCompName("222Block-1", "solidworks materials", "6061 Alloy")
' ElseIf firstmaterial = "6061OSS" Then
' ErrorCodeObj = SolidManagerObj.SetLibraryMaterialToAllBodiesByCompName("222Block-1", "solidworks materials", "6061-O (SS)")
' ElseIf firstmaterial = "6061T4SS" Then
' ErrorCodeObj = SolidManagerObj.SetLibraryMaterialToAllBodiesByCompName("222Block-1", "solidworks materials", "6061-T4 (SS)")
' ElseIf firstmaterial = "6061T6SS" Then
' ErrorCodeObj = SolidManagerObj.SetLibraryMaterialToAllBodiesByCompName("222Block-1", "solidworks materials", "6061-T6 (SS)")
' ElseIf firstmaterial = "6063O" Then
' ErrorCodeObj = SolidManagerObj.SetLibraryMaterialToAllBodiesByCompName("222Block-1", "solidworks materials", "6063-O")
' ElseIf firstmaterial = "6063OExtrudedRodSS" Then
' ErrorCodeObj = SolidManagerObj.SetLibraryMaterialToAllBodiesByCompName("222Block-1", "solidworks materials", "6063-O, Extruded Rod (SS)")
' ElseIf firstmaterial = "6063T1" Then
' ErrorCodeObj = SolidManagerObj.SetLibraryMaterialToAllBodiesByCompName("222Block-1", "solidworks materials", "6063-T1")
' ElseIf firstmaterial = "6063T4" Then
' ErrorCodeObj = SolidManagerObj.SetLibraryMaterialToAllBodiesByCompName("222Block-1", "solidworks materials", "6063-T4")
' ElseIf firstmaterial = "6063T5" Then
' ErrorCodeObj = SolidManagerObj.SetLibraryMaterialToAllBodiesByCompName("222Block-1", "solidworks materials", "6063-T5")
' ElseIf firstmaterial = "6063T6" Then
' ErrorCodeObj = SolidManagerObj.SetLibraryMaterialToAllBodiesByCompName("222Block-1", "solidworks materials", "6063-T6")
' ElseIf firstmaterial = "6063T6RodSS" Then
' ErrorCodeObj = SolidManagerObj.SetLibraryMaterialToAllBodiesByCompName("222Block-1", "solidworks materials", "6063-T6, Rod (SS)")
' ElseIf firstmaterial = "6063T83" Then
' ErrorCodeObj = SolidManagerObj.SetLibraryMaterialToAllBodiesByCompName("222Block-1", "solidworks materials", "6063-T83")
' ElseIf firstmaterial = "7050T73510" Then
' ErrorCodeObj = SolidManagerObj.SetLibraryMaterialToAllBodiesByCompName("222Block-1", "solidworks materials", "7050-T73510")
' ElseIf firstmaterial = "7050T7451" Then
' ErrorCodeObj = SolidManagerObj.SetLibraryMaterialToAllBodiesByCompName("222Block-1", "solidworks materials", "7050-T7451")
' ElseIf firstmaterial = "7050T7651" Then
' ErrorCodeObj = SolidManagerObj.SetLibraryMaterialToAllBodiesByCompName("222Block-1", "solidworks materials", "7050-T7651")
' ElseIf firstmaterial = "7075T6SN" Then
' ErrorCodeObj = SolidManagerObj.SetLibraryMaterialToAllBodiesByCompName("222Block-1", "solidworks materials", "7075-T6 (SN)")
' ElseIf firstmaterial = "7075T6PlateSS" Then
' ErrorCodeObj = SolidManagerObj.SetLibraryMaterialToAllBodiesByCompName("222Block-1", "solidworks materials", "7075-T6, Plate (SS)")
' ElseIf firstmaterial = "7079Alloy" Then
' ErrorCodeObj = SolidManagerObj.SetLibraryMaterialToAllBodiesByCompName("222Block-1", "solidworks materials", "7079 Alloy")
' ElseIf firstmaterial = "AA356F" Then
' ErrorCodeObj = SolidManagerObj.SetLibraryMaterialToAllBodiesByCompName("222Block-1", "solidworks materials", "AA356.0-F")
' ElseIf firstmaterial = "AA380Fdie" Then
' ErrorCodeObj = SolidManagerObj.SetLibraryMaterialToAllBodiesByCompName("222Block-1", "solidworks materials", "AA380.0-F die")
' ElseIf firstmaterial = "Alumina" Then
' ErrorCodeObj = SolidManagerObj.SetLibraryMaterialToAllBodiesByCompName("222Block-1", "solidworks materials", "Alumina")
' ElseIf firstmaterial = "C355T61PermanentMoldCastSS" Then
' ErrorCodeObj = SolidManagerObj.SetLibraryMaterialToAllBodiesByCompName("222Block-1", "solidworks materials", "C355.0-T61 Permanent Mold cast (SS)")
' ElseIf firstmaterial = "Aluminum Bronze" Then
' ErrorCodeObj = SolidManagerObj.SetLibraryMaterialToAllBodiesByCompName("222Block-1", "solidworks materials", "Aluminum Bronze")
' ElseIf firstmaterial = "BerylliumCopperUNSC17000" Then
' ErrorCodeObj = SolidManagerObj.SetLibraryMaterialToAllBodiesByCompName("222Block-1", "solidworks materials", "Beryllium Copper, UNS C17000")
' ElseIf firstmaterial = "BerylliumCopperUNSC17200" Then
' ErrorCodeObj = SolidManagerObj.SetLibraryMaterialToAllBodiesByCompName("222Block-1", "solidworks materials", "Beryllium Copper, UNS C17200")
' ElseIf firstmaterial = "BerylliumCopperUNSC17300" Then
' ErrorCodeObj = SolidManagerObj.SetLibraryMaterialToAllBodiesByCompName("222Block-1", "solidworks materials", "Beryllium Copper, UNS C17300")
' ElseIf firstmaterial = "BerylliumS200FVacuumHotPressed" Then
' ErrorCodeObj = SolidManagerObj.SetLibraryMaterialToAllBodiesByCompName("222Block-1", "solidworks materials", "Beryllium S-200F, Vacuum Hot Pressed")
' ElseIf firstmaterial = "BerylliumS65CVacuumHotPressed" Then
' ErrorCodeObj = SolidManagerObj.SetLibraryMaterialToAllBodiesByCompName("222Block-1", "solidworks materials", "Beryllium S-65C, Vacuum Hot Pressed")
' ElseIf firstmaterial = "Brass" Then
' ErrorCodeObj = SolidManagerObj.SetFavLibraryMaterialToAllBodiesByCompName("222Block-1", "solidworks materials", "Brass")
' ElseIf firstmaterial = "ChromiumCopperUNSC18200" Then
' ErrorCodeObj = SolidManagerObj.SetLibraryMaterialToAllBodiesByCompName("222Block-1", "solidworks materials", "Chromium Copper, UNS C18200")
' ElseIf firstmaterial = "CommercialBronzeUNSC220009010Bronze" Then
' ErrorCodeObj = SolidManagerObj.SetLibraryMaterialToAllBodiesByCompName("222Block-1", "solidworks materials", "Commercial Bronze, UNS C22000 (90-10 Bronze)")
' ElseIf firstmaterial = "Copper" Then
' ErrorCodeObj = SolidManagerObj.SetFavLibraryMaterialToAllBodiesByCompName("222Block-1", "solidworks materials", "Copper")
' ElseIf firstmaterial = "CopperCobaltBerylliumAlloyUNSC17500" Then
' ErrorCodeObj = SolidManagerObj.SetFavLibraryMaterialToAllBodiesByCompName("222Block-1", "solidworks materials", "CopperCobaltBerylliumAlloyUNSC17500")
' ElseIf firstmaterial = "FreeCuttingBrassUNSC36000" Then
' ErrorCodeObj = SolidManagerObj.SetLibraryMaterialToAllBodiesByCompName("222Block-1", "solidworks materials", "Free-Cutting Brass, UNS C36000")
' ElseIf firstmaterial = "HighLeadedBrassUNSC34200" Then
' ErrorCodeObj = SolidManagerObj.SetLibraryMaterialToAllBodiesByCompName("222Block-1", "solidworks materials", "High-leaded brass, UNS C34200")
' ElseIf firstmaterial = "LeadedCommercialBronze" Then
' ErrorCodeObj = SolidManagerObj.SetLibraryMaterialToAllBodiesByCompName("222Block-1", "solidworks materials", "Leaded Commercial Bronze")
' ElseIf firstmaterial = "ManganeseBronze" Then
' ErrorCodeObj = SolidManagerObj.SetLibraryMaterialToAllBodiesByCompName("222Block-1", "solidworks materials", "Manganese Bronze")
' ElseIf firstmaterial = "NickelSilver6512UNSC75700" Then
' ErrorCodeObj = SolidManagerObj.SetLibraryMaterialToAllBodiesByCompName("222Block-1", "solidworks materials", "Nickel silver 65-12, UNS C75700")
' ElseIf firstmaterial = "PhosphorBronze10DUNSC52400" Then
' ErrorCodeObj = SolidManagerObj.SetLibraryMaterialToAllBodiesByCompName("222Block-1", "solidworks materials", "Phosphor bronze 10% D, UNS C52400")
' ElseIf firstmaterial = "TinBearingBronze" Then
' ErrorCodeObj = SolidManagerObj.SetLibraryMaterialToAllBodiesByCompName("222Block-1", "solidworks materials", "Tin Bearing Bronze")
' ElseIf firstmaterial = "WroughtCopper" Then
' ErrorCodeObj = SolidManagerObj.SetLibraryMaterialToAllBodiesByCompName("222Block-1", "solidworks materials", "Wrought Copper")
' ElseIf firstmaterial = "CommerciallyPureCPTiUNSR50400SS" Then
' ErrorCodeObj = SolidManagerObj.SetLibraryMaterialToAllBodiesByCompName("222Block-1", "solidworks materials", "Commercially Pure CP-Ti UNS R50400 (SS)")
' ElseIf firstmaterial = "CommerciallyPureCPTiUNSR50700Grade4SS" Then
' ErrorCodeObj = SolidManagerObj.SetLibraryMaterialToAllBodiesByCompName("222Block-1", "solidworks materials", "Commercially Pure CP-Ti UNS R50700 Grade 4 (SS)")
' ElseIf firstmaterial = "ComerciallyPureGrde2LongitudinalSS" Then
' ErrorCodeObj = SolidManagerObj.SetLibraryMaterialToAllBodiesByCompName("222Block-1", "solidworks materials", "Commercially Pure grade 2 longitudinal (SS)")
' ElseIf firstmaterial = "ComerciallyPureGrade2TexturedSS" Then
' ErrorCodeObj = SolidManagerObj.SetLibraryMaterialToAllBodiesByCompName("222Block-1", "solidworks materials", "Commercially Pure Grade 2 Textured (SS)")
' ElseIf firstmaterial = "ComerciallyPureTitaniumTi55UNSR50550" Then
' ErrorCodeObj = SolidManagerObj.SetLibraryMaterialToAllBodiesByCompName("222Block-1", "solidworks materials", "Commercially Pure titanium (Ti-55) UNS R50550*")
' ElseIf firstmaterial = "Ti10V2Fe3AlSolutionTreatedBarSS" Then
' ErrorCodeObj = SolidManagerObj.SetLibraryMaterialToAllBodiesByCompName("222Block-1", "solidworks materials", "Ti-10V-2Fe-3Al Solution Treated Bar (SS)")
' ElseIf firstmaterial = "Ti3Al8V6Cr4Mo4ZrSS" Then
' ErrorCodeObj = SolidManagerObj.SetLibraryMaterialToAllBodiesByCompName("222Block-1", "solidworks materials", "Ti-3Al-8V-6Cr-4Mo-4Zr (SS)")
' ElseIf firstmaterial = "Ti5Al25SnAnnealedSS" Then
' ErrorCodeObj = SolidManagerObj.SetLibraryMaterialToAllBodiesByCompName("222Block-1", "solidworks materials", "Ti-5Al-2.5Sn Annealed (SS)")
' ElseIf firstmaterial = "Ti6Al2Sn2Zr2Mo2Cr025SiSS" Then
' ErrorCodeObj = SolidManagerObj.SetLibraryMaterialToAllBodiesByCompName("222Block-1", "solidworks materials", "Ti-6Al-2Sn-2Zr-2Mo-2Cr-0.25Si (SS)")
' ElseIf firstmaterial = "Ti6Al4VSolutionTreatedandAgedSS" Then
' ErrorCodeObj = SolidManagerObj.SetLibraryMaterialToAllBodiesByCompName("222Block-1", "solidworks materials", "Ti-6Al-4VSolution treated and aged (SS)")
' ElseIf firstmaterial = "Ti8Al1Mo1VAnnealedSheetSS" Then
' ErrorCodeObj = SolidManagerObj.SetLibraryMaterialToAllBodiesByCompName("222Block-1", "solidworks materials", "Ti-8Al-1Mo-1V annealed sheet (SS)")
' ElseIf firstmaterial = "Ti8MnAnnealedSheetSS" Then
' ErrorCodeObj = SolidManagerObj.SetLibraryMaterialToAllBodiesByCompName("222Block-1", "solidworks materials", "Ti-8Mn annealed sheet (SS)")
' ElseIf firstmaterial = "TIMETAL35ACPTitanium991Ti" Then
' ErrorCodeObj = SolidManagerObj.SetLibraryMaterialToAllBodiesByCompName("222Block-1", "solidworks materials", "TIMETAL 35A CP Titanium (ASTM Grade 1) 99.1 Ti")
' ElseIf firstmaterial = "TitaniumTi13V11Cr3AlSolutionTreated" Then
' ErrorCodeObj = SolidManagerObj.SetLibraryMaterialToAllBodiesByCompName("222Block-1", "solidworks materials", "Titanium Ti-13V-11Cr-3Al Solution Treated")
' ElseIf firstmaterial = "TitaniumTi5Al25Sn" Then
' ErrorCodeObj = SolidManagerObj.SetLibraryMaterialToAllBodiesByCompName("222Block-1", "solidworks materials", "Titanium Ti-5Al-2.5Sn")
' ElseIf firstmaterial = "TitaniumTi8Al1Mo1V" Then
' ErrorCodeObj = SolidManagerObj.SetLibraryMaterialToAllBodiesByCompName("222Block-1", "solidworks materials", "Titanium Ti-8Al-1Mo-1V")
' ElseIf firstmaterial = "TitaniumTi8MnAnnealed" Then
' ErrorCodeObj = SolidManagerObj.SetLibraryMaterialToAllBodiesByCompName("222Block-1", "solidworks materials", "Titanium Ti-8Mn, Annealed")
' ElseIf firstmaterial = "ZincAc41AAlloyAsCast" Then
' ErrorCodeObj = SolidManagerObj.SetLibraryMaterialToAllBodiesByCompName("222Block-1", "solidworks materials", "Zinc AC41A Alloy, As Cast")
' ElseIf firstmaterial = "ZincAC43ADieCast" Then
' ErrorCodeObj = SolidManagerObj.SetLibraryMaterialToAllBodiesByCompName("222Block-1", "solidworks materials", "Zinc AC43A (Zn-4Al-2.5Cu-0.04Mg; Number 2 Die Casting Alloy; Zamak 2), Die Cast")
' ElseIf firstmaterial = "ZincAG40ACast" Then
' ErrorCodeObj = SolidManagerObj.SetLibraryMaterialToAllBodiesByCompName("222Block-1", "solidworks materials", "Zinc AG40A (Zn-4Al-0.4Mg; Zamak 3), Cast")
' ElseIf firstmaterial = "ZincAlloy7" Then
' ErrorCodeObj = SolidManagerObj.SetLibraryMaterialToAllBodiesByCompName("222Block-1", "solidworks materials", "Zinc Alloy 7; AG40B; Zn-4Al-0.015Mg")
' ElseIf firstmaterial = "DuranickelR301" Then
' ErrorCodeObj = SolidManagerObj.SetLibraryMaterialToAllBodiesByCompName("222Block-1", "solidworks materials", "Duranickel(R) 301")
' ElseIf firstmaterial = "MagnesiumAlloy" Then
' ErrorCodeObj = SolidManagerObj.SetLibraryMaterialToAllBodiesByCompName("222Block-1", "solidworks materials", "Magnesium Alloy")
' ElseIf firstmaterial = "MonelR400" Then
' ErrorCodeObj = SolidManagerObj.SetLibraryMaterialToAllBodiesByCompName("222Block-1", "solidworks materials", "Monel(R) 400")
' ElseIf firstmaterial = "ABS" Then
' ErrorCodeObj = SolidManagerObj.SetLibraryMaterialToAllBodiesByCompName("222Block-1", "solidworks materials", "ABS")
' ElseIf firstmaterial = "AcrylicMediumHighImpact" Then
' ErrorCodeObj = SolidManagerObj.SetLibraryMaterialToAllBodiesByCompName("222Block-1", "solidworks materials", "Acrylic (Medium-high impact)")
' ElseIf firstmaterial = "CA" Then
' ErrorCodeObj = SolidManagerObj.SetLibraryMaterialToAllBodiesByCompName("222Block-1", "solidworks materials", "CA")
' ElseIf firstmaterial = "Delrin2700NC010LowViscosityAcetateCopolymerSS" Then
' ErrorCodeObj = SolidManagerObj.SetLibraryMaterialToAllBodiesByCompName("222Block-1", "solidworks materials", "Delrin2700NC010LowViscosityAcetateCopolymerSS")
' ElseIf firstmaterial = "EpoxyUnfilled" Then
' ErrorCodeObj = SolidManagerObj.SetLibraryMaterialToAllBodiesByCompName("222Block-1", "solidworks materials", "Epoxy, Unfilled")
' ElseIf firstmaterial = "EPDM" Then
' ErrorCodeObj = SolidManagerObj.SetLibraryMaterialToAllBodiesByCompName("222Block-1", "solidworks materials", "EPDM")
' ElseIf firstmaterial = "MelamineResin" Then
' ErrorCodeObj = SolidManagerObj.SetLibraryMaterialToAllBodiesByCompName("222Block-1", "solidworks materials", "Melamine resin")
' ElseIf firstmaterial = "Nylon101" Then
' ErrorCodeObj = SolidManagerObj.SetLibraryMaterialToAllBodiesByCompName("222Block-1", "solidworks materials", "Nylon 101")
' ElseIf firstmaterial = "Nylon610" Then
' ErrorCodeObj = SolidManagerObj.SetLibraryMaterialToAllBodiesByCompName("222Block-1", "solidworks materials", "Nylon 6/10")
' ElseIf firstmaterial = "PAType6" Then
' ErrorCodeObj = SolidManagerObj.SetLibraryMaterialToAllBodiesByCompName("222Block-1", "solidworks materials", "PA Type 6")
' ElseIf firstmaterial = "PBTGenerealPurpose" Then
' ErrorCodeObj = SolidManagerObj.SetFavLibraryMaterialToAllBodiesByCompName("222Block-1", "solidworks materials", "PBT General Purpose")
' ElseIf firstmaterial = "PCHighVelocity" Then
' ErrorCodeObj = SolidManagerObj.SetLibraryMaterialToAllBodiesByCompName("222Block-1", "solidworks materials", "PC High Viscosity")
' ElseIf firstmaterial = "PEHighDensity" Then
' ErrorCodeObj = SolidManagerObj.SetLibraryMaterialToAllBodiesByCompName("222Block-1", "solidworks materials", "PE High Density")
' ElseIf firstmaterial = "PELow/MediumDensity" Then
' ErrorCodeObj = SolidManagerObj.SetLibraryMaterialToAllBodiesByCompName("222Block-1", "solidworks materials", "PE Low/Medium Density")
' ElseIf firstmaterial = "PerspexTMGSAcrylicCastSheet" Then
' ErrorCodeObj = SolidManagerObj.SetLibraryMaterialToAllBodiesByCompName("222Block-1", "solidworks materials", "PerspexTMGSAcrylicCastSheet")
' ElseIf firstmaterial = "PF" Then
' ErrorCodeObj = SolidManagerObj.SetLibraryMaterialToAllBodiesByCompName("222Block-1", "solidworks materials", "PF")
' ElseIf firstmaterial = "PolybutadienePB" Then
' ErrorCodeObj = SolidManagerObj.SetLibraryMaterialToAllBodiesByCompName("222Block-1", "solidworks materials", "Polybutadiene (PB)")
' ElseIf firstmaterial = "PBTP" Then
' ErrorCodeObj = SolidManagerObj.SetLibraryMaterialToAllBodiesByCompName("222Block-1", "solidworks materials", "PBTP")
' ElseIf firstmaterial = "PEI" Then
' ErrorCodeObj = SolidManagerObj.SetLibraryMaterialToAllBodiesByCompName("222Block-1", "solidworks materials", "PEI")
' ElseIf firstmaterial = "PolyesterResin" Then
' ErrorCodeObj = SolidManagerObj.SetLibraryMaterialToAllBodiesByCompName("222Block-1", "solidworks materials", "Polyester Resin")
' ElseIf firstmaterial = "PolyesterPolyol" Then
' ErrorCodeObj = SolidManagerObj.SetLibraryMaterialToAllBodiesByCompName("222Block-1", "solidworks materials", "Polyether Polyol")
' ElseIf firstmaterial = "PolyetheretherketonePEEK" Then
' ErrorCodeObj = SolidManagerObj.SetLibraryMaterialToAllBodiesByCompName("222Block-1", "solidworks materials", "Polyetheretherketone (PEEK)")
' ElseIf firstmaterial = "PolyethyleneCrossLinked" Then
' ErrorCodeObj = SolidManagerObj.SetLibraryMaterialToAllBodiesByCompName("222Block-1", "solidworks materials", "PolyethyleneCrossLinked")
' ElseIf firstmaterial = "PEHighDensityFilm" Then
' ErrorCodeObj = SolidManagerObj.SetLibraryMaterialToAllBodiesByCompName("222Block-1", "solidworks materials", "PE High Density Film")
' ElseIf firstmaterial = "PELowDensityFilm" Then
' ErrorCodeObj = SolidManagerObj.SetLibraryMaterialToAllBodiesByCompName("222Block-1", "solidworks materials", "PE Low Density Film")
' ElseIf firstmaterial = "PET" Then
' ErrorCodeObj = SolidManagerObj.SetLibraryMaterialToAllBodiesByCompName("222Block-1", "solidworks materials", "PET")
' ElseIf firstmaterial = "PMMA" Then
' ErrorCodeObj = SolidManagerObj.SetLibraryMaterialToAllBodiesByCompName("222Block-1", "solidworks materials", "PMMA")
' ElseIf firstmaterial = "POMAcetalCopolymer" Then
' ErrorCodeObj = SolidManagerObj.SetLibraryMaterialToAllBodiesByCompName("222Block-1", "solidworks materials", "POM Acetal Copolymer")
' ElseIf firstmaterial = "PPCopolymer" Then
' ErrorCodeObj = SolidManagerObj.SetLibraryMaterialToAllBodiesByCompName("222Block-1", "solidworks materials", "PP Copolymer")
' ElseIf firstmaterial = "PPE" Then
' ErrorCodeObj = SolidManagerObj.SetLibraryMaterialToAllBodiesByCompName("222Block-1", "solidworks materials", "PPE")
' ElseIf firstmaterial = "PPS" Then
' ErrorCodeObj = SolidManagerObj.SetLibraryMaterialToAllBodiesByCompName("222Block-1", "solidworks materials", "PPS")
' ElseIf firstmaterial = "PPHOmopolymer" Then
' ErrorCodeObj = SolidManagerObj.SetLibraryMaterialToAllBodiesByCompName("222Block-1", "solidworks materials", "PP Homopolymer")
' ElseIf firstmaterial = "PPFilm" Then
' ErrorCodeObj = SolidManagerObj.SetLibraryMaterialToAllBodiesByCompName("222Block-1", "solidworks materials", "PPFilm")
' ElseIf firstmaterial = "PSHI" Then
' ErrorCodeObj = SolidManagerObj.SetLibraryMaterialToAllBodiesByCompName("222Block-1", "solidworks materials", "PS HI")
' ElseIf firstmaterial = "PTFEGeneral" Then
' ErrorCodeObj = SolidManagerObj.SetLibraryMaterialToAllBodiesByCompName("222Block-1", "solidworks materials", "PTFEGeneral")
' ElseIf firstmaterial = "PUR" Then
' ErrorCodeObj = SolidManagerObj.SetLibraryMaterialToAllBodiesByCompName("222Block-1", "solidworks materials", "PUR")
' ElseIf firstmaterial = "PVAL" Then
' ErrorCodeObj = SolidManagerObj.SetLibraryMaterialToAllBodiesByCompName("222Block-1", "solidworks materials", "PVAL")
' ElseIf firstmaterial = "PVB" Then
' ErrorCodeObj = SolidManagerObj.SetLibraryMaterialToAllBodiesByCompName("222Block-1", "solidworks materials", "PVB")
' ElseIf firstmaterial = "PVC0007Plasticized" Then
' ErrorCodeObj = SolidManagerObj.SetLibraryMaterialToAllBodiesByCompName("222Block-1", "solidworks materials", "PVC 0.007 Plasticized")
' ElseIf firstmaterial = "PVCRigid" Then
' ErrorCodeObj = SolidManagerObj.SetLibraryMaterialToAllBodiesByCompName("222Block-1", "solidworks materials", "PVC Rigid")
' ElseIf firstmaterial = "SheetMouldingCompound" Then
' ErrorCodeObj = SolidManagerObj.SetLibraryMaterialToAllBodiesByCompName("222Block-1", "solidworks materials", "Sheet Moulding Compound")
' ElseIf firstmaterial = "SMA" Then
' ErrorCodeObj = SolidManagerObj.SetLibraryMaterialToAllBodiesByCompName("222Block-1", "solidworks materials", "SMA")
' ElseIf firstmaterial = "VeryLowDensityPESS" Then
' ErrorCodeObj = SolidManagerObj.SetLibraryMaterialToAllBodiesByCompName("222Block-1", "solidworks materials", "Very Low Density PE (SS)")
' ElseIf firstmaterial = "Beryllium" Then
' ErrorCodeObj = SolidManagerObj.SetLibraryMaterialToAllBodiesByCompName("222Block-1", "solidworks materials", "Beryllium")
' ElseIf firstmaterial = "Cobalt" Then
' ErrorCodeObj = SolidManagerObj.SetLibraryMaterialToAllBodiesByCompName("222Block-1", "solidworks materials", "Cobalt")
' ElseIf firstmaterial = "Molybdenum" Then
' ErrorCodeObj = SolidManagerObj.SetLibraryMaterialToAllBodiesByCompName("222Block-1", "solidworks materials", "Molybdenum")
' ElseIf firstmaterial = "NickelSilver6512UNSC75700" Then
' ErrorCodeObj = SolidManagerObj.SetFavLibraryMaterialToAllBodiesByCompName("222Block-1", "solidworks materials", "Nickel")
' ElseIf firstmaterial = "PureGold" Then
' ErrorCodeObj = SolidManagerObj.SetLibraryMaterialToAllBodiesByCompName("222Block-1", "solidworks materials", "Pure Gold")
' ElseIf firstmaterial = "PureLead" Then
' ErrorCodeObj = SolidManagerObj.SetLibraryMaterialToAllBodiesByCompName("222Block-1", "solidworks materials", "Pure Lead")
' ElseIf firstmaterial = "PureSilver" Then
' ErrorCodeObj = SolidManagerObj.SetLibraryMaterialToAllBodiesByCompName("222Block-1", "solidworks materials", "Pure Silver")
' ElseIf firstmaterial = "Titanium" Then
' ErrorCodeObj = SolidManagerObj.SetLibraryMaterialToAllBodiesByCompName("222Block-1", "solidworks materials", "Titanium")
' ElseIf firstmaterial = "Tungsten" Then
' ErrorCodeObj = SolidManagerObj.SetLibraryMaterialToAllBodiesByCompName("222Block-1", "solidworks materials", "Tungsten")
' ElseIf firstmaterial = "Vanadium" Then
' ErrorCodeObj = SolidManagerObj.SetLibraryMaterialToAllBodiesByCompName("222Block-1", "solidworks materials", "Vanadium")
' ElseIf firstmaterial = "Zirconium" Then
' ErrorCodeObj = SolidManagerObj.SetLibraryMaterialToAllBodiesByCompName("222Block-1", "solidworks materials", "Zirconium")
' ElseIf firstmaterial = "Air" Then
' ErrorCodeObj = SolidManagerObj.SetLibraryMaterialToAllBodiesByCompName("222Block-1", "solidworks materials", "Air")
' ElseIf firstmaterial = "CeramicPorcelain" Then
' ErrorCodeObj = SolidManagerObj.SetLibraryMaterialToAllBodiesByCompName("222Block-1", "solidworks materials", "Ceramic Porcelain")
' ElseIf firstmaterial = "CorrugatedPaper" Then
' ErrorCodeObj = SolidManagerObj.SetLibraryMaterialToAllBodiesByCompName("222Block-1", "solidworks materials", "CorrugatedPaper")
' ElseIf firstmaterial = "Glass" Then
' ErrorCodeObj = SolidManagerObj.SetLibraryMaterialToAllBodiesByCompName("222Block-1", "solidworks materials", "Glass")
' ElseIf firstmaterial = "Cgraphite" Then
' ErrorCodeObj = SolidManagerObj.SetLibraryMaterialToAllBodiesByCompName("222Block-1", "solidworks materials", "C (Graphite)")
' ElseIf firstmaterial = "PolyurethaneFoamFlexible" Then
' ErrorCodeObj = SolidManagerObj.SetLibraryMaterialToAllBodiesByCompName("222Block-1", "solidworks materials", "PolyurethaneFoamFlexible")
' ElseIf firstmaterial = "PolyurethaneFoamRigid" Then
' ErrorCodeObj = SolidManagerObj.SetLibraryMaterialToAllBodiesByCompName("222Block-1", "solidworks materials", "PolyurethaneFoamRigid")
' ElseIf firstmaterial = "Rubber" Then
' ErrorCodeObj = SolidManagerObj.SetFavLibraryMaterialToAllBodiesByCompName("222Block-1", "solidworks materials", "Rubber")
' ElseIf firstmaterial = "Water" Then
' ErrorCodeObj = SolidManagerObj.SetLibraryMaterialToAllBodiesByCompName("222Block-1", "solidworks materials", "Water")
' ElseIf firstmaterial = "AGlassFiber" Then
' ErrorCodeObj = SolidManagerObj.SetLibraryMaterialToAllBodiesByCompName("222Block-1", "solidworks materials", "AGlassFiber")
' ElseIf firstmaterial = "CGlassFiber" Then
' ErrorCodeObj = SolidManagerObj.SetLibraryMaterialToAllBodiesByCompName("222Block-1", "solidworks materials", "CGlassFiber")
' ElseIf firstmaterial = "EGlassFiber" Then
' ErrorCodeObj = SolidManagerObj.SetLibraryMaterialToAllBodiesByCompName("222Block-1", "solidworks materials", "EGlassFiber")
' ElseIf firstmaterial = "SGlassFiber" Then
' ErrorCodeObj = SolidManagerObj.SetLibraryMaterialToAllBodiesByCompName("222Block-1", "solidworks materials", "SGlassFiber")
' ElseIf firstmaterial = "HexcelAS4C" Then
' ErrorCodeObj = SolidManagerObj.SetLibraryMaterialToAllBodiesByCompName("222Block-1", "solidworks materials", "HexcelAS4C")
' ElseIf firstmaterial = "ThornelMatVMA" Then
' ErrorCodeObj = SolidManagerObj.SetLibraryMaterialToAllBodiesByCompName("222Block-1", "solidworks materials", "ThornelMatVMA")
' ElseIf firstmaterial = "ThornelVCB20CarbonCloth" Then
' ErrorCodeObj = SolidManagerObj.SetLibraryMaterialToAllBodiesByCompName("222Block-1", "solidworks materials", "ThornelVCB20CarbonCloth")
' ElseIf firstmaterial = "ZoltekPanex33" Then
' ErrorCodeObj = SolidManagerObj.SetLibraryMaterialToAllBodiesByCompName("222Block-1", "solidworks materials", "ZoltekPanex33")
' ElseIf firstmaterial = "Silicon" Then
' ErrorCodeObj = SolidManagerObj.SetLibraryMaterialToAllBodiesByCompName("222Block-1", "solidworks materials", "Silicon")
' ElseIf firstmaterial = "SiliconDioxide" Then
' ErrorCodeObj = SolidManagerObj.SetLibraryMaterialToAllBodiesByCompName("222Block-1", "solidworks materials", "SiliconDioxide")
' ElseIf firstmaterial = "BUTYL" Then
' ErrorCodeObj = SolidManagerObj.SetLibraryMaterialToAllBodiesByCompName("222Block-1", "solidworks materials", "BUTYL")
' ElseIf firstmaterial = "EPDM60Duromeeter" Then
' ErrorCodeObj = SolidManagerObj.SetLibraryMaterialToAllBodiesByCompName("222Block-1", "solidworks materials", "EPDM60Duromeeter")
' ElseIf firstmaterial = "EPICHLOROHYDRIN" Then
' ErrorCodeObj = SolidManagerObj.SetLibraryMaterialToAllBodiesByCompName("222Block-1", "solidworks materials", "EPICHLOROHYDRIN")
' ElseIf firstmaterial = "HYPALON" Then
' ErrorCodeObj = SolidManagerObj.SetLibraryMaterialToAllBodiesByCompName("222Block-1", "solidworks materials", "HYPALON")
' ElseIf firstmaterial = "NaturalRubber" Then
' ErrorCodeObj = SolidManagerObj.SetLibraryMaterialToAllBodiesByCompName("222Block-1", "solidworks materials", "NaturalRubber")
' ElseIf firstmaterial = "NBR" Then
' ErrorCodeObj = SolidManagerObj.SetLibraryMaterialToAllBodiesByCompName("222Block-1", "solidworks materials", "NBR")
' ElseIf firstmaterial = "NEOPRENE" Then
' ErrorCodeObj = SolidManagerObj.SetLibraryMaterialToAllBodiesByCompName("222Block-1", "solidworks materials", "NEOPRENE")
' ElseIf firstmaterial = "POLYURETHANE11671" Then
' ErrorCodeObj = SolidManagerObj.SetLibraryMaterialToAllBodiesByCompName("222Block-1", "solidworks materials", "POLYURETHANE11671")
' ElseIf firstmaterial = "SANTOPREME" Then
' ErrorCodeObj = SolidManagerObj.SetLibraryMaterialToAllBodiesByCompName("222Block-1", "solidworks materials", "SANTOPREME")
' ElseIf firstmaterial = "SBR" Then
' ErrorCodeObj = SolidManagerObj.SetLibraryMaterialToAllBodiesByCompName("222Block-1", "solidworks materials", "SBR")
' ElseIf firstmaterial = "SiliconRubber" Then
' ErrorCodeObj = SolidManagerObj.SetLibraryMaterialToAllBodiesByCompName("222Block-1", "solidworks materials", "SiliconRubber")
' ElseIf firstmaterial = "VITON" Then
' ErrorCodeObj = SolidManagerObj.SetLibraryMaterialToAllBodiesByCompName("222Block-1", "solidworks materials", "VITON")
' ElseIf firstmaterial = "Balsa" Then
' ErrorCodeObj = SolidManagerObj.SetLibraryMaterialToAllBodiesByCompName("222Block-1", "solidworks materials", "Balsa")
' ElseIf firstmaterial = "Beech" Then
' ErrorCodeObj = SolidManagerObj.SetLibraryMaterialToAllBodiesByCompName("222Block-1", "solidworks materials", "Beech")
' ElseIf firstmaterial = "Cedar" Then
' ErrorCodeObj = SolidManagerObj.SetLibraryMaterialToAllBodiesByCompName("222Block-1", "solidworks materials", "Cedar")
' ElseIf firstmaterial = "Mahogany" Then
' ErrorCodeObj = SolidManagerObj.SetLibraryMaterialToAllBodiesByCompName("222Block-1", "solidworks materials", "Mahogany")
' ElseIf firstmaterial = "Maple" Then
' ErrorCodeObj = SolidManagerObj.SetLibraryMaterialToAllBodiesByCompName("222Block-1", "solidworks materials", "Maple")
' ElseIf firstmaterial = "Oak" Then
' ErrorCodeObj = SolidManagerObj.SetLibraryMaterialToAllBodiesByCompName("222Block-1", "solidworks materials", "Oak")
' ElseIf firstmaterial = "Pine" Then
' ErrorCodeObj = SolidManagerObj.SetLibraryMaterialToAllBodiesByCompName("222Block-1", "solidworks materials", "Pine")
' ElseIf firstmaterial = "Teak" Then
' ErrorCodeObj = SolidManagerObj.SetLibraryMaterialToAllBodiesByCompName("222Block-1", "solidworks materials", "Teak")
' Else
' End If
'End If

Outcomes