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

iLogic component replace within nested subassemblies

To start off, I'm new to iLogic.

I'm looking to replace all ipt files of a certain name with my own file. I believe I have a working ilogic rule that allows me to do just that. My problem is this rule only works within a single iam file, searching for an ipt and replacing it. I need this rule to propagate from a high level assembly and search all assembly files, sometimes two or three tier nested assemblies.

 

This is what I've managed to come up with that seems to work within a single assembly file.

 

 

 

oOccurrences = ThisDoc.Document.ComponentDefinition.Occurrences

For Each oComp As ComponentOccurrence In oOccurrences
    oCompName = oComp.Name
    If InStr(oCompName, "PnC") > 0 Then
        Component.Replace(oCompName,"Weld.ipt", True)
    End If
Next