BOM table seems to not update when deleting rows thru API

Goodmorning everyone,

I`m running into a very annoing thing with the Solidworks BOM list.

Here`s what I did.

the bom is a Indented one, it displays only items that have a value of 1 on the property wearpart.

Now, this property wearpart exists on assemblies and parts, however due to the ERP import, I want to delete the parts of the assembly that has the value of 1 on wearpart.

What I did is create a few loops.

First I find the assembly in the BOM list, when it finds that it starts looping thru any part lines and deletes them. This is working just fine.

The problem starts when I want to continue from the Line were it found the assembly.

So if that Line is 7, It will Continue from 7 down until it finds another assembly, here`s were it gets weird. On the background the BOM list seems unaltered, it still has the same amount of rows as when I started before deleting anything. so Line 8 is still the part of the assembly which we just deleted.

Am I missing some sort of a rebuild? cause if I put watches on the count of the maximum rows it never changes even after deleting a few rows the maximum number of rows is unchanged, it only changes when I rerun the Whole Sub, which is not very effective.

I am using DeleteRow Method (ITableAnnotation) to delete a row from my Table

Well after putting in some nightwork its solved, they mention in the API help that you need to call the total number of rows each time you delete a row. this has solved my initial problem.