Grouping multiple material styles to a single folder

Not applicable
08-31-2015
05:55 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Hey all,
I made the following code to group together Inventor material styles and save them in the format that my company uses for our files. I'm just wondering if there is a better way to accomplish this? I feel like my method is very simple and not the best for processing. Any help is appreciated!
' Get the material property. Dim invMaterialProperty As Property Set invMaterialProperty = oDoc. _ PropertySets.Item("Design Tracking Properties").Item("Material") Dim isAnswer As Boolean isAnswer = True If invMaterialProperty.Value = "A-36" Or invMaterialProperty.Value = "Steel, Mild" Or invMaterialProperty.Value = "MILD STEEL" Then invMaterialProperty.Value = "44W" ElseIf invMaterialProperty.Value = "GPO-3" Or invMaterialProperty.Value = "Extren500" Or invMaterialProperty.Value = "NEOPRENE" Or invMaterialProperty.Value = "PROTECTOLITE/EXTREEN" Then invMaterialProperty.Value = "GPO" ElseIf invMaterialProperty.Value = "400 BHN" Then invMaterialProperty.Value = "AR400" ElseIf invMaterialProperty.Value = "500 BHN" Then invMaterialProperty.Value = "AR500" ElseIf invMaterialProperty.Value = "600 BHN" Then invMaterialProperty.Value = "AR600" ElseIf invMaterialProperty.Value = "5083-H32/H116" Then invMaterialProperty.Value = "5083" ElseIf invMaterialProperty.Value = "QT100" Or invMaterialProperty.Value = "100Q" Then Do While isAnswer = True typeAns = InputBox(Prompt:="Which material would you like?" & vbCrLf & "Type 1 for 100Q or 2 for QT100", Title:="Material Select") If typeAns = "1" Then invMaterialProperty.Value = "100Q" isAnswer = False Exit Do ElseIf typeAns = "2" Then invMaterialProperty.Value = "QT100" isAnswer = False Exit Do End If Loop ElseIf invMaterialProperty.Value = "6061-T6 CHK'D." Then invMaterialProperty.Value = "6061CHK" ElseIf invMaterialProperty.Value = "6061-T6" Then invMaterialProperty.Value = "6061" ElseIf invMaterialProperty.Value = "Stainless Steel" Or invMaterialProperty.Value = "316 L SS" Then invMaterialProperty.Value = "316 SS" ElseIf invMaterialProperty.Value = "304 L SS" Then invMaterialProperty.Value = "304 SS" ElseIf invMaterialProperty.Value = "UHMW, Black" Or invMaterialProperty.Value = "UHMW, White" Then invMaterialProperty.Value = "UHMW" End If
Brendan