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

Select by area size or path length?

Enthusiast ,
Feb 22, 2017 Feb 22, 2017

Copy link to clipboard

Copied

Is there a script or plug-in that would allow the selection of objects that are above or below a certain threshold for area size or path length?

For example, I want to select and delete all objects that have an area of less than 1 mm². Or a path length less than 1mm.

Or just select paths that are over 1000mm long or more than 1000 mm² in size?

(Running CC2017 / Mac)

Views

3.2K

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

Community Expert , Feb 23, 2017 Feb 23, 2017

You could try this

#target illustrator

// deletes pathItems smaller than the supplied length

var idoc = app.activeDocument;

var howLong = prompt ("Enter the size in points of small paths to be deleted", 2, "Delete Small Paths");

for (i=0 ; i< idoc.pathItems.length; i++)

     {

          var ipath = idoc.pathItems

               if ( ipath.width < howLong && ipath.height < howLong)

                    {

                         ipath.selected = true;

                    }

     }

app.redraw();

if(confirm ("Pro

...

Votes

Translate

Translate
Adobe
Community Expert ,
Feb 23, 2017 Feb 23, 2017

Copy link to clipboard

Copied

You could try this

#target illustrator

// deletes pathItems smaller than the supplied length

var idoc = app.activeDocument;

var howLong = prompt ("Enter the size in points of small paths to be deleted", 2, "Delete Small Paths");

for (i=0 ; i< idoc.pathItems.length; i++)

     {

          var ipath = idoc.pathItems

               if ( ipath.width < howLong && ipath.height < howLong)

                    {

                         ipath.selected = true;

                    }

     }

app.redraw();

if(confirm ("Proceed to delete selected items?", "yes", "Confirm Delete"))

     {

          app.cut();

     }

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
New Here ,
Apr 25, 2020 Apr 25, 2020

Copy link to clipboard

Copied

This script has a bug - 

var ipath = idoc.pathItems

should be

var ipath = idoc.pathItems[i];

 

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
Community Expert ,
Apr 26, 2020 Apr 26, 2020

Copy link to clipboard

Copied

LATEST

all scripts got messed up when we migrated to the new Forums 😞

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