While Loop Parent Counts with Component Delete
Posted: Fri Sep 30, 2011 4:20 pm
Im just trying to verify something when Im running a while loop in a TI.
Currently Im looping a dimension and looking for any elements that have more than 1 parent. If they have more than one parent then I want to remove the component from all parents after the first one.
The issue I have is that when you delete an element from a consolidation then the element no longer has the same number of parents. During the while loop you are looking at the parent index which is changed if you delete the element from a consolidation.
Is this a true statement? and if so then do you simply delete 1 from the parent count if you perform a delete instead of adding 1 to the index during the loop?
Currently Im looping a dimension and looking for any elements that have more than 1 parent. If they have more than one parent then I want to remove the component from all parents after the first one.
The issue I have is that when you delete an element from a consolidation then the element no longer has the same number of parents. During the while loop you are looking at the parent index which is changed if you delete the element from a consolidation.
Is this a true statement? and if so then do you simply delete 1 from the parent count if you perform a delete instead of adding 1 to the index during the loop?