Select a body by location

Gabriel Messager
Gabriel Messager Member, Employee Posts: 54
10 Comments 5 Likes Name Dropper First Anniversary
✭✭✭✭
edited June 2023 in 3D Design

Select a body by location

Comments

  • Gabriel Messager
    Gabriel Messager Member, Employee Posts: 54
    10 Comments 5 Likes Name Dropper First Anniversary
    ✭✭✭✭
    x = 0
    y = 31
    z = -20
    box_ref = Box.Create(Point.Create(MM(x), MM(y), MM(z)))
    
    for body in GetRootPart().GetAllBodies():
        body_box = body.Shape.GetBoundingBox(Matrix.Identity)
        if (box_ref & body_box).IsEmpty==False:
            Selection.Create(body).SetActive()