How can I get the Beam objects from my active selection?

Gabriel Messager
Gabriel Messager Member, Employee Posts: 49
5 Likes Name Dropper First Anniversary Ansys Employee

How can I get the Beam objects from my active selection?

Answers

  • Gabriel Messager
    Gabriel Messager Member, Employee Posts: 49
    5 Likes Name Dropper First Anniversary Ansys Employee
    #Get Beam from curves
    
    dict_beams = {}
    for beam in GetRootPart().Beams:
        dict_beams[Selection.Create(beam).ConvertToCurves().Items[0]] = beam
    
    my_sel = Selection.GetActive()
    list_beams = [dict_beams[item] for item in my_sel.Items]