Copy link to clipboard
Copied
I tried deleting the path items where the width and height is zero.
If there are 3 such pathitems, iam unable to delete the last item, it returns the error 'No such element' in vb.net.
for i=1 to app.activeDocument.pathItems.count
if app.activeDocument.pathItems(i).width=0 then
app.activeDocument.pathItems(i).delete
end if
next
Please let me know the problem in the above lines.
regards,
Sashi
Because when you delete items, the index is rechecked. Delete 2 of pathItems, pathItems(3) no longer exists.
So instead of increase the index, you should use decrease order.
Copy link to clipboard
Copied
Because when you delete items, the index is rechecked. Delete 2 of pathItems, pathItems(3) no longer exists.
So instead of increase the index, you should use decrease order.
Copy link to clipboard
Copied
Thank you. This works fine now.