12-04-2019
02:01 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
12-04-2019
02:01 PM
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
Solved! Go to Solution.