Show messages:
1-12
…
253-272
273-292
293-312
313-332
333-352
353-372
From: Cemortan_Tudor
can't find script for "select similar edge length"
From: Michael Gibson
Hi Tudor,
re:
> can't find script for "select similar edge length"
Is it one in this thread? :
http://moi3d.com/forum/lmessages.php?webtag=MOI&msg=8905.1
- Michael
From: Cemortan_Tudor
not quite that i'm searching for
there's a filter for curves biggest, smallest, or min/max , but I'm searching for edges
example - extrude taped, select one side edge of taped - run the script -> fillet/chamfer
or draw a rectangle, extrude by x amount, select 1 edge of height - run the script, or select the edge of original rectangle run the script
i've forgot lots of moi's scripting
select desired edge
moi.geometryDatabase.getSelectedObjects().getEdges().item(0).getLength(); get's edge selection length
get parent object(want only for current selection, in case there are duplicates of same object), get edges, loop through edges, if there's similar length - select
or if i Have a selected edge how can i get object numEdges count for the loop
by my understanding it should be ~ moi.geometryDatabase.getSelectedObjects().getTopLevelObjects().item(0).getEdges().numEdges
moi.geometryDatabase.getSelectedObjects() -> selected
.getTopLevelObjects() -> object itself
.item(0) - object nr
.getEdges() - all the edges
.numEdges - count edges
that doesn't work
From: Michael Gibson
Hi Tudor, the problem in your script there is this part:
> .getTopLevelObjects() -> object itself
All the " getXXXXX()" methods on an object list do are filtering mechanisms, they make a new list that only contains the given types that are already present in the current list.
So if you had an object list with 2 objects in it, an edge and a brep, when you call getTopLevelObjects() it would return a list with just the brep in it, that's the only top level object currently in the list.
If you have an object list with just one edge in it, calling getTopLevelObjects() on it will return an empty list because there are no top level objects directly in the list currently.
You need to instead do something like this:
var objs = moi.geometryDatabase.getSelectedObjects(); if ( objs.numEdges == 1 ) { var edge = objs.item(0); var edges = edge.getParentBRep().getEdges(); moi.ui.alert( edges.length); }
So get the edge object, call getParentBRep() on it to get the parent brep, then call getEdges() on that.
- Michael
From: Cemortan_Tudor
thanks !
/* select similar length edge*/
var edgeSelected = moi.geometryDatabase.getSelectedObjects().getEdges().item(0).getLength();
var objs = moi.geometryDatabase.getSelectedObjects();
var tollerance = 1000;
if ( objs.numEdges == 1 ) {
var edge = objs.item(0);
var edgeL = objs.item(0).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;
}
}
From: Cemortan_Tudor
idk if fillets will be changed for v5
~ an addition - last created on fillet failed, but building the supported faces - to select new created faces
From: Michael Gibson
Hi Tudor, you can select faces that were created by the last run command by using this script in v4:
script: /* Select fillet surfaces */ moi.geometryDatabase.deselectAll(); var breps = moi.geometryDatabase.getLastCreated().getBReps();
for ( var i = 0; i < breps.length; ++i ) { var faces = breps.item(i).getFaces(); for ( var j = 0; j < faces.length; ++j )
{ var f = faces.item(j); if ( f.isNew ) f.selected = true; } }
So for example after doing a fillet that will select all the fillet surfaces.
- Michael
From: Frenchy Pilou (PILOU)
Cool !
And something for select only "Flat Faces" ? (not especially after the last function)
From: Michael Gibson
Hi Pilou, planar faces can be selected using the detailed object properties dialog.
Select the solid first, then click "Details...", then click the label where it shows the number of faces, then click the label that shows the number of planar faces.
There will be another way in v5 using the Types section of the scene browser.
- Michael
From: Frenchy Pilou (PILOU)
Ah excellent i have totally forgotten this!
From: Phiro
Idem
I forgot this possibility I knew.
But when I don't use it often, I forget to use this trick.
Thanks for this Michael !
From: Cemortan_Tudor
Ohayo
Is it possible to bind hotkeys to mouse 4/5 and combinations with those ?
~ default moi doesnt support that, any other softwares ?
From: Michael Gibson
Hi Tudor, sorry no MoI does not itself have any way to use extra mouse buttons.
> ~ default moi doesnt support that, any other softwares ?
Probably some kind of utility could be used for this, what operating system are you using?
- Michael
From: Cemortan_Tudor
win 10
From: Michael Gibson
There's a utility program called AutoHotKey that can do that type of stuff.
- Michael
From: Cemortan_Tudor
expanding boolDifference
1. for closed curves
if curves aren't on same frame(missdraw or random snap) will perform boolD to first plane
2. for selection of breps and curves, curves will be ignored - boolean will be applied only to breps
Attachments:
BooleanDifference.js
From: Cemortan_Tudor
fillet
c - swap between constant distance and circular
Attachments:
Fillet.js
From: Cemortan_Tudor
example of swapping from hard edge to soft(circular)
edge can be trimmed with a line, after chamfer - trimmed edges will remain & can be selected for next fillet
https://gifyu.com/image/eWdv
From: Cemortan_Tudor
ohayo !
sweep question, how can a rect automatch a sweep profile ? or any other curved shape(planar) ?
panneling or border workflow
From: Michael Gibson
Hi Tudor, I'm sorry I don't really understand the question. Are you asking about the "autoplace" mode for Sweep? That is turned on if a sweep profile is outside of the rail curve's bounding box. When it's on the sweep profile will be moved to the rail and rotated to align with the rail's tangent and then swept along the rail path.
If the profile curve is inside the bounding box of the rail curve then it will not be moved and will be swept from it's current position.
- Michael
Show messages:
1-12
…
253-272
273-292
293-312
313-332
333-352
353-372