- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
I have a guide bar part with up to 100 lanes, each with the features lane extrusion (cut), a chamfer (named tilt) for its top and bottom and a shared fillet for each half of the lanes (1-50 and 52-100). Lane 51 is special as sometimes its suppression state depends on whether there are an odd or even number of lanes. The attached code looks at what lanes are to be included and then either suppresses or unsuppresses them based on this metric. However, suppressing from 100 down to 40 took almost half an hour, and unsuppressing back to 100 took about 20 minutes. Suppressing a given lane suppresses its chamfers as well. Does suppressing the chamfers explicitly despite this make it take longer to run?
Is there anything else I'm missing, or is it just the sheer volume causing the long time?
Dim functionalChains As Integer = Chains
Dim realMode As String = Mode
Dim notMode As String
If Mode = "Infeed" Then
notMode = "Discharge"
Else
notMode = "Infeed"
End If
Parameter.UpdateAfterChange = True
iLogicVb.UpdateWhenDone = True
If Chains Mod 2 = 0 Then
' first lane either side of middle has pitch/2 from middle to make pitch normal there
Parameter("InfeedPMod") = InfeedPitch / 2
Parameter("DischargePMod") = DischargePitch / 2
Else
' no pitch difference here and overlapped lane will be eliminated so middle lane is directly in middle for odd number of lanes
' functional chains +1 as lane 50 and 100 will still be outermost even if 99 chains selected as middle lane 51 is not there
Parameter("InfeedPMod") = 0
Parameter("DischargePMod") = 0
functionalChains += 1
End If
' loop through all lanes and disable/enable if lane falls into scope of chains number
Dim i As Integer
For i = 1 To 100 Step 1
If i <= 50 And i > (functionalChains / 2) Then
Feature.IsActive(realMode & " Bottom Tilt Lane " & i) = False
Feature.IsActive(realMode & " Top Tilt Lane " & i) = False
Feature.IsActive("Lane " & i) = False
Else If i > 50 And i-50 > functionalChains/2
Feature.IsActive(realMode & " Bottom Tilt Lane " & i) = False
Feature.IsActive(realMode & " Top Tilt Lane " & i) = False
Feature.IsActive("Lane " & i) = False
Else
Feature.IsActive(realMode & " Bottom Tilt Lane " & i) = True
Feature.IsActive(realMode & " Top Tilt Lane " & i) = True
Feature.IsActive("Lane " & i) = True
End If
Next i
' lane 51 doesn't exist if odd number of lanes (as 1 and 51 placed on top of each other)
If Chains Mod 2 = 1 Then
Feature.IsActive(realMode & " Bottom Tilt Lane 51") = False
Feature.IsActive(realMode & " Top Tilt Lane 51") = False
Feature.IsActive(realMode & " Lane 51 Fillet") = False
Feature.IsActive("Lane 51") = False
Else
Feature.IsActive(realMode & " Bottom Tilt Lane 51") = True
Feature.IsActive(realMode & " Top Tilt Lane 51") = True
Feature.IsActive(realMode & " Lane 51 Fillet") = True
Feature.IsActive("Lane 51") = True
End If
Try
Feature.IsActive(realMode & " M6 Side Hole") = True
Feature.IsActive(realMode & " Side Hole Mirror") = True
Feature.IsActive(notMode & " Side Hole Mirror") = False
Feature.IsActive(notMode & " M6 Side Hole") = False
Catch
End Try
Solved! Go to Solution.