Announcements
Attention for Customers without Multi-Factor Authentication or Single Sign-On - OTP Verification rolls out April 2025. Read all about it here.
mgreenmachine
973 Views, 6 Replies

Rule to suppress Component Patterns with zero value

I am trying to write a rule that automatically suppresses any and all component patterns in an assembly which have an instance value of zero. I would like to somehow scan the active assembly for any component patterns with a zero value, but I'm not sure how to do that (I've put my attempt to do so in bold below). I'm quite inexperienced with iLogic/coding. Below is the best I could come up with. Any help would be greatly appreciated!

Dim oDef As AssemblyComponentDefinition = ThisApplication.ActiveDocument.ComponentDefinition

Dim oPattern As OccurrencePattern 

For Each oPattern In oDef.OccurrencePatterns
	If oPattern.value = 0
		oPattern.Suppressed = True
	End If
Next