Message 1 of 3
Immediate parameter update in iLogic rule

Not applicable
06-26-2019
04:42 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
I've searched and incorporated proposed solutions to this, but not finding it working. Hashed rule posted below. Below just a step in developing a more comprehensive approach (form input etc).
I want to input a value for a parameter and then be given the value of a dependent function based parameter, then be prompted to adjust the first parameter if required. However the dependent parameter returned is the old value; it isn't updating immediately. Relevant Sub is Format_L. Anyone who can help? Thanks!
Sub main 'check that this active document is a part file Dim partDoc As PartDocument 'call subs SetProjectProperties Format_L AppendSBPrefix InventorVb.DocumentUpdate() End Sub Sub Format_L 'Set the relevant left side run length and squab parameters Parameter("Length_A") = InputBox("Please enter overall booth run length 'A' in mm", "Layout length 'A'", Length_A) Parameter("Squab_No_A") = InputBox("Please enter number of squabs reguired for run length 'A'", "No. squabs run 'A'", Squab_No_A) 'Set the relevant right side run length and squab parameters Parameter("Length_B") = InputBox("Please enter overall booth run length 'B' in mm", "Layout length 'B'", Length_B) Parameter("Squab_No_B") = InputBox("Please enter number of squabs reguired for run length 'B'", "No. squabs run 'B'", Squab_No_B) 'Update the parameters immediately RuleParametersOutput() InventorVb.DocumentUpdate() 'Set the relevant carcass parameters Parameter("Carcass_Length_Limit") = InputBox("Please enter maximum carcass length for shipping/handling", "Carcass limit length", Carcass_Length_Limit) Parameter("Spine_No_A") = InputBox(Spine_Spacing_IS_A, "Please adjust run 'A' spine quantity if required", Spine_No_A) Parameter("Spine_No_B") = InputBox(Spine_Spacing_IS_B, "Please adjust run 'B' spine quantity if required", Spine_No_B) End Sub Sub SetProjectProperties Dim oProject As String Dim oProductNo As String oProject = InputBox("Enter the Sales Order number", "Sales Order", iProperties.Value("Project", "Project")) oProductNo = InputBox("Enter the Product Number for this layout", "Product Number", iProperties.Value("Project", "Part Number")) 'write input back to custom iProperty iProperties.Value("Project", "Project") = oProject iProperties.Value("Project", "Part Number") = oProductNo oPrefix = oProductNo & "_" iProperties.Value("Custom", "Prefix") = oPrefix End Sub Sub AppendSBPrefix 'define the active document partDoc = ThisApplication.ActiveDocument Dim SB As SurfaceBody Dim SBName 'write the prefix oPrefix = iProperties.Value("Custom", "Prefix") 'rename all solid bodies incrementing counter (counter not presently used, left in event required later) Dim i As Integer i = 1 For Each SB In partDoc.ComponentDefinition.SurfaceBodies SB.Name = oPrefix + SB.Name i = i + 1 Next End Sub