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

Gabriel Messager
Gabriel Messager Member, Employee Posts: 56
Second Anniversary 10 Comments 5 Likes Name Dropper
✭✭✭✭

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

Answers

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