How to create character-specific Local Marks using pyfbsdk? MotionBuilder

I need to create Local Marks in MotionBuilder specifically for selected characters using PyFbsdk. The marks should only be created when a character is selected.

much thanks!