-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathKit Property Add.txt
More file actions
39 lines (33 loc) · 1.21 KB
/
Kit Property Add.txt
File metadata and controls
39 lines (33 loc) · 1.21 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
SharedVariable("LogVar") = "Kit Prop Add"
iLogicVB.RunExternalRule("Write SV to Log.iLogicVB")
Dim oDoc As Document = ThisApplication.ActiveDocument
oCustomPropertySet = ThisDoc.Document.PropertySets.Item("Inventor User Defined Properties")
Dim KitProps As New List(Of String)
KitProps.Add("JobNum")
KitProps.Add("DETAILER")
KitProps.Add("Element_Desc")
KitProps.Add("DesignLevel")
If oDoc.DocumentType = kDrawingDocumentObject Then
MessageBox.Show("Smart Part Config can only be run in a Part or Assembly", "File Type Error")
Else If oDoc.DocumentType = kPresentationDocumentObject Then
MessageBox.Show("Smart Part Config can only be run in a Part or Assembly", "File Type Error")
Else
For Each TTProp In KitProps
Try
prop = oCustomPropertySet.Item(TTProp)
Catch
oCustomPropertySet.Add("", TTProp)
End Try
Next
Dim oCompDef as AssemblyComponentDefinition = oDoc.ComponentDefinition
'DesignLevel
Try
param = Parameter.Param("DesignLevel")
Catch
oMyParameter=oCompDef.Parameters.UserParameters
oParameter=oMyParameter.AddByValue("DesignLevel", "", UnitsTypeEnum.kTextUnits)
MultiValue.SetList("DesignLevel", "Show", "Element", "Kit", "Stock")
Parameter("DesignLevel") = "Kit"
End Try
End If