How to create a named selection of concave/convex fillet radius in Discovery?

Javier Vique
Javier Vique Member, Employee Posts: 84
Second Anniversary 5 Answers 25 Likes 10 Comments
✭✭✭✭

We want to select all rounds equal or smaller of a given radius defined by the user and create a named selection with those whose shape is concave and another with those convex.

Tagged:

Answers

  • Javier Vique
    Javier Vique Member, Employee Posts: 84
    Second Anniversary 5 Answers 25 Likes 10 Comments
    ✭✭✭✭
    edited March 14

    PowerSelection method includes an option to filter depending on convex/concave shape. We can make use of it to create our named selections. Please be aware that this scripts makes the rounds search on all available bodies.

    UserRadius = InputHelper.CreateTextBox('Radius(mm)','All fillet below this radius will be selected')
    InputHelper.PauseAndGetInput('Select a max fillet radius',UserRadius)
    
    selConvex = PowerSelection.Faces.ByRoundRadius(MM(float(UserRadius.Value)), 
    PowerSelectOptions(False, BodySelection.Create(GetRootPart().GetAllBodies())), 
    SearchCriteria.SizeComparison.SmallerOrEqual, 
    SearchCriteria.RoundType.Convex)
    selConvex.SetActive()
    result = NamedSelection.Create(selConvex, Selection.Empty())
    result.CreatedNamedSelection.SetName("ConvexFaces")
    
    selConcave = PowerSelection.Faces.ByRoundRadius(MM(float(UserRadius.Value)), 
    PowerSelectOptions(False, BodySelection.Create(GetRootPart().GetAllBodies())), 
    SearchCriteria.SizeComparison.SmallerOrEqual, 
    SearchCriteria.RoundType.Concave)
    selConcave.SetActive()
    result = NamedSelection.Create(selConcave, Selection.Empty())
    result.CreatedNamedSelection.SetName("ConcaveFaces")
    
    Selection.Clear()