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

Gabriel Messager
Gabriel Messager Member, Employee Posts: 54
10 Comments 5 Likes Name Dropper First Anniversary
✭✭✭✭

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

Answers

  • Gabriel Messager
    Gabriel Messager Member, Employee Posts: 54
    10 Comments 5 Likes Name Dropper First Anniversary
    ✭✭✭✭
    #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]