Message 1 of 5
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
I have been using this subroutine to suppress or unsuppress features. But I am finding that it is taking quite a while to process.
For a single ipt it takes 12-15 seconds which seems like a lot.
It gets worse with an assembly of 3-4 components, I have timed it taking over 2 minutes to push all the parameters into the component files and run the feature supression rules in the components.
Is there a more efficient way to suppress components that I can implement into my code to speed things up?
Sub Main Call Feature_State("Active", "LH SEEN") Call Feature_State("Active", "RH SEEN") If Seen_End_Configuration = "BOTH ENDS SEEN" Then Else If Seen_End_Configuration = "NO ENDS SEEN" Then Call Feature_State("Suppressed", "LH SEEN") Call Feature_State("Suppressed", "RH SEEN") Else If Seen_End_Configuration = "LH END SEEN" Then Call Feature_State("Suppressed", "RH SEEN") Else If Seen_End_Configuration = "RH END SEEN" Then Call Feature_State("Suppressed", "LH SEEN") End If RuleParametersOutput() iLogicVb.UpdateWhenDone = True End Sub Sub Feature_State(State As String, Searchterm As String) Dim oFeature As PartFeature Dim oFeatures As PartFeatures oFeatures = ThisDoc.Document.ComponentDefinition.Features If State = "Active" Then For Each oFeature In oFeatures If oFeature.Name.Contains(Searchterm) = True Then oFeature.Suppressed = False End If Next Else If State = "Suppressed" Then For Each oFeature In oFeatures If oFeature.Name.Contains(Searchterm) = True Then oFeature.Suppressed = True End If Next End If End Sub
Solved! Go to Solution.