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

Javier Vique
Javier Vique Member, Employee Posts: 69
First Answer First Anniversary Name Dropper 5 Likes

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: 69
    First Answer First Anniversary Name Dropper 5 Likes
    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()