Select face by location (Rayfire)

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

How to select a face by location?

Comments

  • Gabriel Messager
    Gabriel Messager Member, Employee Posts: 54
    Ansys Employee First Anniversary Name Dropper 5 Likes
    ✭✭✭✭
    def locfindface(xx,yy,zz):
    
        searchPoint = Point.Create(MM(xx), MM(yy),MM(zz))
        direction = Direction.DirX
        rayOrigin = searchPoint + (direction.UnitVector * -.001)
        list = RayFire.Fire(rayOrigin, direction, 1E-10, 1E-5)
    
        for item in list:
            if isinstance(item, IDesignFace):
                Selection.Create(item).CreateAGroup("my_face")
                break;
    
    locfindface(5.54,10,14.45)