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

Count all unsupressed occurrences in an assembly with iLogic

Hi All,

 

I have a rule that a looks through each component in an assembly and counts the occurrences of a specified part, to allow for virtual parts to be generated for nut bolts and such.

 

The rule errors out when it encounters a suppressed component, is there a way to check if components are suppressed and skip those components.

 

Any suggestions would be appreciated 

 

 

'iterate through all Of the occurrences in the Assembly
For Each oOcc In oOccs
MessageBox.Show(oOcc.Name)
'Trace.WriteLine(oOcc.Name, "iLogic") 'debug 
	 If Left(oOcc.Name, oCnt) = sComponent Then 
   			iQTY += 1 'count the components
	
   	End If

    'look at only virtual components
    If TypeOf oOcc.Definition Is VirtualComponentDefinition Then
        'find and delete existing virtual parts by name
        If Left(oOcc.Name,oCnt2 +1) = sVirtPart & ":" Then
		'delete existing virtual parts if name matches
        oOcc.delete
		End If
    End If
Next