Skip to main content
Participating Frequently
February 25, 2011
Question

script to delete the line which is small in length and line on one another

  • February 25, 2011
  • 2 replies
  • 1503 views

I have lot of small unwanted lines which to be deleted manually any script which can help to deleted small line and If I delete one line i can see below it one or two line on the same line any script which can delete it.

Please help me, just by cleaning the drawing views my eyes and hands are paining

thanks in advance...

regards

Laks

This topic has been closed for replies.

2 replies

CarlosCanto
Community Expert
Community Expert
February 26, 2011

this will take care of getting rid off the small paths

#target illustrator

// deletes pathItems smaller than the supplied length

var idoc = app.activeDocument;

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

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

     {

          var ipath = idoc.pathItems

               if ( ipath.length < howLong)

                    {

                         ipath.selected = true;

                    }

     }

app.redraw();

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

     {

          app.cut();

     }

Larry G. Schneider
Community Expert
Community Expert
March 1, 2011

Thanks, Carlos. I was able to modify it slightly to use the area of the items and it works great. I had one in Applescript from a couple of years ago and this gave me the opportunity to share a JS version with my colleagues on Windows systems.

CarlosCanto
Community Expert
Community Expert
March 1, 2011

glad to help, Larry

Larry G. Schneider
Community Expert
Community Expert
February 25, 2011

What OS are you using?


ganthrajAuthor
Participating Frequently
February 28, 2011

I am using Windows xp or Vista and next 2 or 3 months windows 7

using Illustrator CS5