Skip to main content
Participating Frequently
Feb 25, 2011 9:23 AM UTC
Question

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

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 is closed to new replies. Start a new post to keep the conversation going.

7 replies

CarlosCanto
Community Expert
Community Expert
Feb 26, 2011 8:24 AM UTC

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();

     }

Translate
Larry G. Schneider
Community Expert
Community Expert
Mar 1, 2011 1:59 AM UTC

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.

Translate
CarlosCanto
Community Expert
Community Expert
Mar 1, 2011 6:48 AM UTC

glad to help, Larry

Translate
Larry G. Schneider
Community Expert
Community Expert
Feb 25, 2011 5:17 PM UTC

What OS are you using?


Translate
ganthrajAuthor
Participating Frequently
Feb 28, 2011 9:00 AM UTC

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

using Illustrator CS5

Translate