This article provides two examples for how to update a parent's relation (part) so that it points to the latest version of a defining item (child). 


        public void UpdateParentPartExplicit(IswItem parent, IswItem oldChild, IswItem newChild)
        {
            IswPart part = parent.FindDefObjPart("ASID", oldChild);
            if (part != null)
                part.DefObj = newChild;
        }
    
    
    
        public void UpdateParentParts(IswItem parent, IswItem newChild)
        {
            foreach(IswPart part in parent.GetAllParts())
            {
                if (part.DefObj is IswItem item)
                {
                    if (item.AncestorHandle == newChild.AncestorHandle)
                        part.DefObj = newChild;
                }
            }
        }