MoI discussion forum
MoI discussion forum

Full Version: Selection grow and shrink script?

Show messages: All  1-3  4-9

From: Max Smirnov (SMIRNOV)
22 Oct 2014   [#4] In reply to [#1]
Hi Metin,

this is expand script
code:
script: function es(edg){ var i,f; for (i=0; i<edg.length; i++) {f=edg.item(i).getFacesOfEdge(); f.setProperty('selected',1);}} var so = moi.geometryDatabase.getSelectedObjects(), sf=so.getFaces(), i; for ( i=0; i<sf.length;i++) es(sf.item(i).getEdges()); es(so.getEdges());


and a shrink script
code:
script: function es(edg){ var i,f; for (i=0; i<edg.length; i++) {f=edg.item(i).getFacesOfEdge(); f.setProperty('selected',0);}} var gd = moi.geometryDatabase; gd.invertSelection(); var so = gd.getSelectedObjects(), sf=so.getFaces(), i; gd.invertSelection(); for ( i=0; i<sf.length;i++) es(sf.item(i).getEdges());

From: Michael Gibson
22 Oct 2014   [#5] In reply to [#4]
Thanks Max!

@Metin - does that do what you needed?

- Michael
From: Metin Seven (SEVENSHEAVEN)
23 Oct 2014   [#6]
Brilliant! It does exactly what I meant. Many thanks, Max!
From: Lordfox
18 Mar 2016   [#7]
Very very usefull - thank you so much.
From: ndrakey
23 Mar 2016   [#8] In reply to [#4]
Is there a way to select whole islands ?

lets say i have two cubes where I select the front 2 faces and convert it to select the 2 cube`s complete faces
From: Michael Gibson
23 Mar 2016   [#9] In reply to [#8]
Hi ndrakey, re:

> lets say i have two cubes where I select the front 2 faces and convert it
> to select the 2 cube`s complete faces

Use "Select All" Ctrl+A to do that - if you have a face or edge sub-object selected, you can then use Ctrl+A / Select All to select all faces or edges of those objects. Once your selection is on a sub-object, select all will see that and select the all the same sub-objects without selecting other top level objects.

So with your cube example, if you have 2 separate cube objects, then you select one front face on each one, press Ctrl+A and then the selection will expand to all the faces on those 2 cubes.

- Michael

Show messages: All  1-3  4-9