Hi Marco,
re:
> Select all objects (solids or surfaces) that belongs to the currently selected edges (and, at
> the same time, deselect the input selected edges)
You can get the selected edges using this:
code:
var edges = moi.geometryDatabase.getSelectedObjects().getEdges();
Then you'll want to loop through every edge something like this:
code:
for ( var i = 0; i < edges.length; ++i )
{
var edge = edges.item(i);
....
}
To deselect the edge you would do:
code:
edge.selected = false;
To get the parent surface or solid of the edge you would do:
code:
edge.getParentBRep();
So putting that all together it would go something like this:
code:
var edges = moi.geometryDatabase.getSelectedObjects().getEdges();
for ( var i = 0; i < edges.length; ++i )
{
var edge = edges.item(i);
edge.selected = false;
edge.getParentBRep().selected = true;
}
Hope that helps! - Michael
|