Dynamic Curve Length Selection?

Next
 From:  OSTexo
7927.1 
Hello,

Is there a plugin/script for MoI that allows for dynamic curve selection based upon it's length? It would be helpful in cleaning up 2D output from MoI to do a mass cleanup of little tiny curves that have been created with the 2D command. I've seen the script concerning select smaller than given size but I think that is based upon bounding box? I'm not sure if I've overlooked a script with this functionality on the forum.

It would be even more awesome to be able to select ranges, for example select all curves measuring between 1mm and 2mm in length. I find myself doing more linework in MoI than even AI and CD and I can see it being useful even in cleaning up imported 2D curves before further design. Thanks.
  Reply Reply More Options
Post Options
Reply as PM Reply as PM
Print Print
Mark as unread Mark as unread
Relationship Relationship
IP Logged

Previous
Next
 From:  Michael Gibson
7927.2 In reply to 7927.1 
Hi OSTexo, I don't remember any already existing script for that, but here is a new one that should do that:

script: /* Select by curve length */ var min = 1.0, max = 5.0; var crvs = moi.geometryDatabase.getObjects().getCurves(); for ( var i = 0; i < crvs.length; ++i ) { var crv = crvs.item(i); var len = crv.getLength(); if ( len>= min && len <= max ) { crv.selected = true; } }


Edit the "min" and "max" values near the start of the script to change the range.

- Michael
  Reply Reply More Options
Post Options
Reply as PM Reply as PM
Print Print
Mark as unread Mark as unread
Relationship Relationship
IP Logged

Previous
Next
 From:  Frenchy Pilou (PILOU)
7927.3 In reply to 7927.2 
Does the script can work also for simple lines?

In fact yes! :)

Just something : Select nothing before call the script!

If you want an only one exact length input same value for Min and Max !:)

French Version
http://moiscript.weebly.com/select-by-length.html

EDITED: 21 Apr 2016 by PILOU

  Reply Reply More Options
Post Options
Reply as PM Reply as PM
Print Print
Mark as unread Mark as unread
Relationship Relationship
IP Logged

Previous
 From:  OSTexo
7927.4 
Hello,

Thank you Michael, this will save me hours of cleanup work.
  Reply Reply More Options
Post Options
Reply as PM Reply as PM
Print Print
Mark as unread Mark as unread
Relationship Relationship
IP Logged
 

Reply to All Reply to All