@kmcga You can try something like this rule. You will need to add this rule to the Property Changed Event Trigger. It will create a history property, and both a copy & history copy parameter since they trigger iLogic better. This will allow changes on the iProperties form but it will be reset & correct when you re-open it.
Sub Main
Dim oDrawingDocument As DrawingDocument = ThisApplication.ActiveDocument
Dim oParams As Parameters = oDrawingDocument.Parameters
Dim oUserParams As UserParameters = oParams.UserParameters
Dim oCustomPropertySet As PropertySet
oCustomPropertySet = oDrawingDocument.PropertySets.Item("Inventor User Defined Properties") ' PropertiesForUserDefinedPropertiesEnum
CreateHistoryAndParametesForProp("Prop1", oUserParams, oCustomPropertySet)
CreateHistoryAndParametesForProp("Prop2", oUserParams, oCustomPropertySet)
CreateHistoryAndParametesForProp("Prop3", oUserParams, oCustomPropertySet)
iLogicVb.UpdateWhenDone = True
End Sub
Function CreateHistoryAndParametesForProp(myPropertyName As String, oUserParams As UserParameters, oCustomPropertySet As PropertySet)
Dim myProperty As Inventor.Property
'Try
myProperty = oCustomPropertySet.Item(myPropertyName)
'Catch
'oCustomPropertySet.Add("", myPropertyName)
'End Try
Try
oUserParams.Item("param" & myPropertyName).Value = iProperties.Value("Custom", myPropertyName)
Catch
oUserParams.AddByValue("param" & myPropertyName, iProperties.Value("Custom", myPropertyName), UnitsTypeEnum.kTextUnits)
End Try
Dim myHistoryProperty As Inventor.Property
Try
myHistoryProperty = oCustomPropertySet.Item(myPropertyName & "History")
Catch
oCustomPropertySet.Add(myProperty.Value, myPropertyName & "History")
End Try
Try
oUserParams.Item("param" & myPropertyName & "History").Value = iProperties.Value("Custom", myPropertyName & "History")
Catch
oUserParams.AddByValue("param" & myPropertyName & "History", iProperties.Value("Custom", myPropertyName & "History"), UnitsTypeEnum.kTextUnits)
End Try
If (iProperties.Value("Project", "Stock Number") <> "0") Then
Try
iProperties.Value("Custom", myPropertyName) = Parameter.Value("param" & myPropertyName & "History")
Catch
'MessageBox.Show("Didn't update " & myPropertyName)
End Try
Else
Try
iProperties.Value("Custom", myPropertyName & "History") = Parameter.Value("param" & myPropertyName)
Catch
'MessageBox.Show("Didn't update " & myPropertyName & "History")
End Try
End If
End Function
If this solved your problem or answered your question, please click ACCEPT SOLUTION.
If this helped you, please click LIKE.