MoI discussion forum
MoI discussion forum

Full Version: Script to select all edges and merge

From: Peticel
23 Sep 2022   [#1]
Hi,

I'm looking for a script to select all edges and merge them.
Any help is appreciated.

From: Michael Gibson
23 Sep 2022   [#2] In reply to [#1]
Hi Peticel, you can select the entire object and then run the Merge command. After selecting the object, push the Tab key, then type merge then push Enter.

Only areas where there are 2 edges meeting that are tangent to each other can be merged.

- Michael
From: Peticel
26 Sep 2022   [#3] In reply to [#2]
Hi Michael, thank you for the reply. This is how I've been doing it until now but I was hoping to bind this to a key.

I've tried this - Ctrl+M - script:moi.geometryDatabase.selectAll(); Merge;
but I get an error message saying - ReferenceError: Can't find variable: Merge

Any suggestions? Thank you in advance!
From: Frenchy Pilou (PILOU)
26 Sep 2022   [#4] In reply to [#3]
Careful Merge is also a Boolean trimming function! ;)
From: Michael Gibson
26 Sep 2022   [#5] In reply to [#3]
Hi Peticel, the problem is that the contents for a shortcut key can either be a command name or it can be script code to run.

But in your case there you've got both of those together.

You'll need to put in this instead:

script:moi.geometryDatabase.selectAll(); moi.command.execCommand( 'Merge' );

- Michael
From: Peticel
26 Sep 2022   [#6] In reply to [#5]
Thank you, Michael. Works perfectly!

Kind regards,
Peticel