Maya scripting: Help using the dragger context/artisan brush

Hello all,

I am having some trouble getting started on a new tool. I need to be able to drag select faces one after the other much like the artisan brush in Maya and perform custom functions on each face as it is selected in turn.

I have tried using artSelectCtx which could work well for me if I could perform custom functions within the context but I cannot figure out how or even if it is possible. I am leaning more towards draggerContext because it seems more flexible in being that I can call specific functionality while you are dragging the mouse i.e. pressCommand or dragCommand.

The issue I am having however is I am stumped with how to select/drag faces like artSelectCtx allows but using dragger context instead. I have looked into raytracing and selecting faces based on your ray position, but have not been able to find any solid info so far.

If anybody could point me in the right direction I would be hugely grateful!