' Note we want to give the user the ability to use either TotalWidth, OR ColumnQTY, OR ' ...FilterWidth to make adjustments to the layout. ' SCENARIO 1 *************************************************************************** ' ************************************************************************************** ' Check if TotalWidth has changed... If TotalWidth <> TotalWidthMemory Then 'MessageBox.Show("Total Width has been changed", "Cadline") ' Adjust Column QTY for current FilterWidth ColumnQTY = Floor(TotalWidth / FilterWidth) ' How much filling is required? FillerWidthCalc = TotalWidth - (ColumnQTY * FilterWidth) ' If necessary add 'filler' filters ' Note FillerWidthCalc > 0 is being used as a Boolean 'True/False' - features are suppressed if FillerWidthCalc is 0 For i = 1 To 3 Feature.IsActive("FillerFilter" & i) = FillerWidthCalc > 0 Next ' Set width of filler filters FillerWidth = FillerWidthCalc ' SCENARIO 2 *************************************************************************** ' ************************************************************************************** ' Check if FilterWidth has changed... Else If FilterWidth <> FilterWidthMemory Then 'MessageBox.Show("Filter Width has been changed", "Cadline") ' Adjust quantity of filter columns to suit TotalWidth ColumnQTY = Floor(TotalWidth/FilterWidth) ' How much filling is required? FillerWidthCalc = TotalWidth - (ColumnQTY * FilterWidth) ' If necessary add 'filler' filters ' Note FillerWidthCalc > 0 is being used as a Boolean 'True/False' - features are suppressed if FillerWidthCalc is 0 For i = 1 To 3 Feature.IsActive("FillerFilter" & i) = FillerWidthCalc > 0 Next ' Set width of filler filters FillerWidth = FillerWidthCalc ' SCENARIO 2 *************************************************************************** ' ************************************************************************************** ' Check if ColumnQTY has changed... Else If ColumnQTY <> ColumnQTYMemory Then 'MessageBox.Show("Column QTY has been changed", "Cadline") ' Adjust FilterWidth to ensure that TotalWidth is correct FilterWidth = TotalWidth / ColumnQTY ' Get rid of any 'filler' filters For i = 1 To 3 Feature.IsActive("FillerFilter" & i) = False Next End If ' ************************************************************************************** ' Remember values for next time... ColumnQTYMemory = ColumnQTY FilterWidthMemory = FilterWidth TotalWidthMemory = TotalWidth ' Output parameters and update model RuleParametersOutput() InventorVb.DocumentUpdate()