• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

delete path items

Guest
Sep 02, 2011 Sep 02, 2011

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

TOPICS
Scripting

Views

672

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines

correct answers 1 Correct answer

Enthusiast , Sep 02, 2011 Sep 02, 2011

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.

Votes

Translate

Translate
Adobe
Enthusiast ,
Sep 02, 2011 Sep 02, 2011

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.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Guest
Sep 02, 2011 Sep 02, 2011

Copy link to clipboard

Copied

LATEST

Thank you. This works fine now.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines