Show messages:
1-20
21-31
From: style7
So far I couldnt find a solution.
Here are the edges I want to select all at once:
I remember Fusion360 for example can detect edges that are tangent to each other and then chain select them (in Fusion it is called chain select, IIRC)
Is there a script or something? this would speed up the process a lot.
Best regards
style7
Attachments:
chain select edge.3dm
Image Attachments:
2024-08-08 11_02_07-MoI.jpg
From: Michael Gibson
Hi style7 there is a different kind of loop select for getting all the edges on a face boundary but it's not quite the same thing:
http://moi3d.com/forum/index.php?webtag=MOI&msg=3335.5
Another thing that's new in v5 with ACIS based filleting is that it will automatically extend the edges being targeted, like if you try to fillet just this one edge of your object:
It will actually automatically extend it to get the entire set you want:
However, in other spots it can decide to stop the chain if there is an opportunity to end the fillet like here:
I'll see about adding in an option for automatically extending a case like this by as far as possible and set up a chain selection helper method.
- Michael
Image Attachments:
style7_chain1.png
style7_chain2.png
style7_chain3.png
style7_chain4.png
From: style7
thanks for the reply. I just tried it a bit but ACIS extends the edges a bit randomly. but sometimes it actually works as I intended.
Would be cool if there'll be chain selection helper, because together with powerful ACIS fillets there would be no need for plasticity/fusion for fillet operations.
Thanks for considering, keep up the great work.
From: Zooen
Bonjour,
There is also this script that works well, even if you sometimes have to select edges several times. I use it every day. There, I selected one of the edges > F5 (my keyboard shortcut for the script (the whole loop is selected) > Fillet with Distance 2 / Circular / Library Solid++.
script :/* Extend Edge Selection */ var angle_degrees = 20; var cos_ang = Math.cos( angle_degrees * Math.PI / 180.0 ); var done_edges =[]; while ( 1 ) { var any_change = false; var edges = moi.geometryDatabase.getSelectedObjects().getEdges(); for ( var i = 0; i < edges.length; ++i ) { var e = edges.item(i); if ( done_edges[e.id] ) continue; done_edges[e.id] = true; var ptA = e.getStartPt(); var ptB = e.getEndPt(); var done_faces = []; var faces = e.getFacesOfEdge(); while ( faces.length> 0 ) { var f = faces.item( faces.length-1 ); faces.removeObjectAt( faces.length-1 ); if ( done_faces[f.id] ) continue; done_faces[f.id] = true; var edges2 = f.getEdges(); for ( var j = 0; j < edges2.length; ++j ) { var e2 = edges2.item(j); var ptC = e2.getStartPt(); var ptD = e2.getEndPt(); var tol = 1.0e-6; var A = false, B = false, C = false, D = false; if ( moi.vectorMath.distance( ptA, ptC ) < tol ) { A = true; C = true; } else if ( moi.vectorMath.distance( ptA, ptD ) < tol ) { A = true; D = true; } else if ( moi.vectorMath.distance( ptB, ptC ) < tol ) { B = true; C = true; } else if ( moi.vectorMath.distance( ptB, ptD ) < tol ) { B = true; D = true; } if ( A || B ) { var tan_e = e.evaluateTangent( A ? e.domainMin : e.domainMax ); var tan_e2 = e2.evaluateTangent( C ? e2.domainMin : e2.domainMax ); if ( Math.abs( (tan_e.x * tan_e2.x) + (tan_e.y * tan_e2.y) + (tan_e.z * tan_e2.z) )> cos_ang ) { if ( !e2.selected ) { e2.selected = true; any_change = true; } } var faces2 = e2.getFacesOfEdge(); for ( var k = 0; k < faces2.length; ++k ) { var f2 = faces2.item(k); if ( !done_faces[f2.id] ) faces.addObject( f2 ); } } } } } if ( !any_change ) break; }
Below is the script file "Extend_Edge_Selection.js to put in C:\Users\xxx\AppData\Roaming\Moi\scripts
Nota : I reloaded the file "Extend_Edge_Selection.js" today 12/08/2024, there was a typographical error, it missed the hyphens of the 8!
From: style7
wow, merci beaucoup!
I just tried it a bit, but it seems to work very well. Amazing!
From: Frenchy Pilou (PILOU)
<< to put in C:\Users\xxx\AppData\Roaming\Moi\scripts
Maybe better to put it in the normal folder commands for have it in the list of custom Ui ?
From: Psygorn (DRILLBIT)
Hi Pilou,
Could you show me how it works in one of your fancy gifs?
It seems I do not know how to work with it!
- Psygorn
Message 11506.8 was deleted
From: MO (MO_TE)
Hi Zooen
The code you posted has a little typo. I think you missed the last bracket at the end.
Here is the correct one:
code:
script :/* Extend edge selection */ var angle_degrees = 20; var cos_ang = Math.cos( angle_degrees * Math.PI / 180.0 ); var done_edges =[]; while ( 1 ) { var any_change = false; var edges = moi.geometryDatabase.getSelectedObjects().getEdges(); for ( var i = 0; i < edges.length; ++i ) { var e = edges.item(i); if ( done_edges[e.id] ) continue; done_edges[e.id] = true; var ptA = e.getStartPt(); var ptB = e.getEndPt(); var done_faces = []; var faces = e.getFacesOfEdge(); while ( faces.length> 0 ) { var f = faces.item( faces.length-1 ); faces.removeObjectAt( faces.length-1 ); if ( done_faces[f.id] ) continue; done_faces[f.id] = true; var edges2 = f.getEdges(); for ( var j = 0; j < edges2.length; ++j ) { var e2 = edges2.item(j); var ptC = e2.getStartPt(); var ptD = e2.getEndPt(); var tol = 1.0e-6; var A = false, B = false, C = false, D = false; if ( moi.vectorMath.distance( ptA, ptC ) < tol ) { A = true; C = true; } else if ( moi.vectorMath.distance( ptA, ptD ) < tol ) { A = true; D = true; } else if ( moi.vectorMath.distance( ptB, ptC ) < tol ) { B = true; C = true; } else if ( moi.vectorMath.distance( ptB, ptD ) < tol ) { B = true; D = true; } if ( A || B ) { var tan_e = e.evaluateTangent( A ? e.domainMin : e.domainMax ); var tan_e2 = e2.evaluateTangent( C ? e2.domainMin : e2.domainMax ); if ( Math.abs( (tan_e.x * tan_e2.x) + (tan_e.y * tan_e2.y) + (tan_e.z * tan_e2.z) )> cos_ang ) { if ( !e2.selected ) { e2.selected = true; any_change = true; } } var faces2 = e2.getFacesOfEdge(); for ( var k = 0; k < faces2.length; ++k ) { var f2 = faces2.item(k); if ( !done_faces[f2.id] ) faces.addObject( f2 ); } } } } } if ( !any_change ) break; }
PS:
One trick to select the edges faster for symmetrical objects is to use the "SelectSimilarLengthEdges" and "ExtentEdgeSelection" scripts together.
Here is a modified version of the "SelectSimilarLengthEdges" script I'm using. It can work on multiple selected edges.
code:
script:/* Select Similar Length Edges ( Multiple Selection ) */ try { var selectedEdges = moi.geometryDatabase.getSelectedObjects().getEdges(); for(p=0; p<selectedEdges.length; p++) { var edge = selectedEdges.item(p); var tollerance = 1000; var edgeL = edge.getLength(); var min = edgeL - edgeL/tollerance; var max = edgeL + edgeL/tollerance; var edges = edge.getParentBRep().getEdges(); for ( var i = 0; i < edges.length; ++i ) { var edgeLoopL = edges.item(i).getLength(); if ( edgeLoopL> min && edgeLoopL< max) edges.item(i).selected = true; } } }catch(e){}
From: Zooen
thank's
the last parenthesis at the end is added in the post.
The .js file was correct and works.
From: Frenchy Pilou (PILOU)
@ Psygorn Sorry for the delay!
Say I have clicked on my list of functions of the custom UI the Extend Edges Selection (Alphabetical sorted)
For me it's more easy than to learn hundred of shortcuts for my old brain!
So
I have just to click one edge then Right Click for recall the last function used (so here the Extend Edges Selection) ;)
with this box of filleted edges or any volumes for any edges selection wanted for any reason...
Remarks :) Same result if you click a liittle filleted edge!
you can select several edges in the same time!!! And on several VOLUMES in the same time!!!
PS The Loop selection don't work for this case!
script:/*Loop selection*/moi.geometryDatabase.selectLoop();
From: Psygorn (DRILLBIT)
Hi Pilou and Zooen,
I don't know why but for some reason this doesn't work for me! when I select an Edge and then run Extend Edges Selection command MOI says "Select Boundary Objects" and it does nothing!
@Pilou I remade your box with fillets on it, but was not able to reproduce what you are showing in your Gif.
- Psygorn
From: Frenchy Pilou (PILOU)
here the file that i used...
https://moiscript.weebly.com/uploads/3/9/3/8/3938813/extendedgeselection.js
And that is working like a charm!
As you see you can select on different volumes in the same time before call the function !
From: Zooen
Hi Psygorn,
I've created a short video in case
1-where the loop you want to select is executed all at once.
2-where the loop you want to select cannot be selected all at once.
The link
https://vimeo.com/997450276
The method is explained in post 11506.8
Can you make your file or object available so we can test it?
From: Psygorn (DRILLBIT)
Hi Zooen,
My model is a simple cube with fillets (take a look at the attached file)
The problem is that it seems the Extend Edge Selection doesn't work for me (Of course I have installed the js script) I did not made a short key for it though!
So, either I did not install the correct script or there is something I cannot figure it out at the moment!
- Psygorn
Attachments:
Extend Edge Selection_Not_Working_for_me.3dm
From: Frenchy Pilou (PILOU)
@ Psygorn
your cubic volume is woking fine for me!
So mystery is total! :)
PS i am on PC
From: Psygorn (DRILLBIT)
Hi Pilou,
so, the Js file is this right?
script :/* Étendre la sélection d'arêtes */ var angle_degrees = 20; var cos_ang = Math.cos( angle_degrees * Math.PI / 180.0 ); var done_edges =[]; while ( 1 ) { var any_change = false; var edges = moi.geometryDatabase.getSelectedObjects().getEdges(); for ( var i = 0; i < edges.length; ++i ) { var e = edges.item(i); if ( done_edges[e.id] ) continue; done_edges[e.id] = true; var ptA = e.getStartPt(); var ptB = e.getEndPt(); var done_faces = []; var faces = e.getFacesOfEdge(); while ( faces.length> 0 ) { var f = faces.item( faces.length-1 ); faces.removeObjectAt( faces.length-1 ); if ( done_faces[f.id] ) continue; done_faces[f.id] = true; var edges2 = f.getEdges(); for ( var j = 0; j < edges2.length; ++j ) { var e2 = edges2.item(j); var ptC = e2.getStartPt(); var ptD = e2.getEndPt(); var tol = 1.0e-6; var A = false, B = false, C = false, D = false; if ( moi.vectorMath.distance( ptA, ptC ) < tol ) { A = true; C = true; } else if ( moi.vectorMath.distance( ptA, ptD ) < tol ) { A = true; D = true; } else if ( moi.vectorMath.distance( ptB, ptC ) < tol ) { B = true; C = true; } else if ( moi.vectorMath.distance( ptB, ptD ) < tol ) { B = true; D = true; } if ( A || B ) { var tan_e = e.evaluateTangent( A ? e.domainMin : e.domainMax ); var tan_e2 = e2.evaluateTangent( C ? e2.domainMin : e2.domainMax ); if ( Math.abs( (tan_e.x * tan_e2.x) + (tan_e.y * tan_e2.y) + (tan_e.z * tan_e2.z) )> cos_ang ) { if ( !e2.selected ) { e2.selected = true; any_change = true; } } var faces2 = e2.getFacesOfEdge(); for ( var k = 0; k < faces2.length; ++k ) { var f2 = faces2.item(k); if ( !done_faces[f2.id] ) faces.addObject( f2 ); } } } } } if ( !any_change ) break; }
and I have installed it in commands folder here: C:\Users\Myname\AppData\Roaming\Moi\commands but there is not .htm file with it could that be the case?
- Psygorn
From: Frenchy Pilou (PILOU)
hml is when there are some menus! It's not the case here! :)
so no htm !
And yes i have the same than your folder!
From: MO (MO_TE)
Hi Psygorn
"Extend Edge Selection.js" has a couple space characters in its name.
When you run the script by typing its name in the input field or setting a shortcut key, it'll run the first piece of the name before the space character.
So, when you type "Extend Edge Selection", it will run the "Extend" command.
There is a simple solution for this:
Change the script name to something without spaces like:
ExtendEdgeSelection.js
or
Extend_Edge_Selection.js
From: Frenchy Pilou (PILOU)
Bravo ! Mystery maybe revealed! :)
But it was on my image list example! ;)
And inside my name file linked! ;)
And no problem if you use the Custom UI because it takes the name itself of the file! ;)
(made without spcace(s) ) Valid_Name, VALide_NAME, etc...
Show messages:
1-20
21-31