// Use this for assigning one float per selected object
// 1  Select the objects.
// 2  Execute this command, addFloatPrimVar("your_prim_name", 1);
  
global proc addFloatPrimVar(string $name, float $value) {
    string $sel[] = `ls -sl`;
    string $fullname = "rmancF" + $name;
    for($current in $sel) {
        string $shapes[] = `listRelatives -s $current`;
        string $shape = $shapes[0];
        if(size($shape) == 0)
            continue;
        if(attributeExists($fullname, $shape) == 0) {
            addAttr -ln $fullname -nn $fullname -k 1 $shape;
            }
        setAttr ($shape + "." + $fullname) $value;
        }
    }