Message 1 of 3
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Hi,
i have a rule that lets me add 5 custom properties to a part.
I wanted to modify the rule so that i can run it in an assembly and add those 5 iproperties to all selected parts.
The rule i use ( it is a rule i found on this Forum and modyfied it):
customPropertySet = ThisDoc.Document.PropertySets.Item("Inventor User Defined Properties") Dim iprop(5) As String iprop(1) = "Materiał" iprop(2) = "Wykończenie" iprop(3) = "Kolor" iprop(4) = "Opis" iprop(5) = "Informacje dodatkowe" For k = 1 To 5 Dim prop(k) As String Try prop(k) = iProperties.Value("Custom", iprop(k)) Catch 'Assume error means not found customPropertySet.Add("", iprop(k)) iProperties.Value("Custom", iprop(k)) = "null" End Try Next For j = 1 To 5 Dim var(j) As String If iProperties.Value("Custom", iprop(j)) = "null" Or iProperties.Value("Custom", iprop(j)) = "" Then var(j) = InputBox("Proszę wpisać wartość dla: " & iprop(j), "Warning", "") iProperties.Value("Custom", iprop(j)) = var(j) Else If j = 1 Or j= 3 Or j= 4 Then question = MessageBox.Show(iprop(j) & " jest już określony: " & vbLf & iProperties.Value("Custom", iprop(j)) & vbLf & "Czy chcesz zmienić " & iprop(j) & "?", "IProperty już określone", MessageBoxButtons.YesNo, MessageBoxIcon.Question, MessageBoxDefaultButton.Button1) If question = vbYes Then var(j) = InputBox("Proszę wpisać nową wartość dla: " & iprop(j), "Warning", "") iProperties.Value("Custom", iprop(j)) = var(j) End If Else If j = 2 Then question = MessageBox.Show(iprop(j) & " jest już określone: " & vbLf & iProperties.Value("Custom", iprop(j)) & vbLf & "Czy chcesz zmienić " & iprop(j) & "?", "IProperty już określone", MessageBoxButtons.YesNo, MessageBoxIcon.Question, MessageBoxDefaultButton.Button1) If question = vbYes Then var(j) = InputBox("Proszę wpisać nową wartość dla: " & iprop(j), "Warning", "") iProperties.Value("Custom", iprop(j)) = var(j) End If Else If j = 5 Then question = MessageBox.Show(iprop(j) & " są już określone: " & vbLf & iProperties.Value("Custom", iprop(j)) & vbLf & "Czy chcesz zmienić " & iprop(j) & "?", "IProperty już określone", MessageBoxButtons.YesNo, MessageBoxIcon.Question, MessageBoxDefaultButton.Button1) If question = vbYes Then var(j) = InputBox("Proszę wpisać nową wartość dla: " & iprop(j), "Warning", "") iProperties.Value("Custom", iprop(j)) = var(j) End If End If End If End If End If Next
I tried modifying it by adding oSelect but i couldnt get it to work
Solved! Go to Solution.