Announcements
Attention for Customers without Multi-Factor Authentication or Single Sign-On - OTP Verification rolls out April 2025. Read all about it here.
J-Camper
in reply to: jfenter

This is another way to do it:

Sub Main
	Dim StringList As String() ={"Width Configured?", "Honeycomb Configured?", "Inner Rail 1 Configured?", "Inner Rail 2 Configured?"} '{"Test", "This"}
	
	If CheckThese(StringList) = False
		MessageBox.Show("Part is not properly configured.  Running rules now.", "Failed Limit Check")
'		iLogicVb.RunRule("Width Check")
'		iLogicVb.RunRule("Panel Length - No Rails")
	Else
		MessageBox.Show("Part is properly configured.  No changes needed.", "Passed Limit Check")
	End If
	
End Sub

Private Function CheckThese(oStrings As String()) As Boolean
	Dim i As Integer = 0
	While i < oStrings.Count
		Result = False
		Try
			prop = iProperties.Value("Custom", oStrings(i))
		Catch
			MessageBox.Show("The iProperty: [ " & oStrings(i) & " ] is missing from this part!", "Missing iProperty")
		    Result = False
			Exit While
		End Try
		If iProperties.Value("Custom", oStrings(i)) = True Then Result = True Else Exit While 
		i=i+1
	End While
	Return Result
End Function

It does the checking in a Private function, that returns to your main rule As a Boolean response.  It is set up so you can check any number of Yes/No iProperties, and returns a False Boolean at the first False value found.  It also handles missing iProperties by prompting the missing property name before returning a False Boolean.