Setting Units In Maya

So I am attempting to set the linear, angle, min and max time, and time (FPS) at startup.

What I have is this:
in my userSetup.mel, I source a file called sceneSetup located in some distant folder.

in that folder I set grid display options, clip planes, channel box precision; and I ATTEMPT to set current linear, angle, time, and min / max frame

Precision gets set, clipping gets set, im sure the grid gets set, but because it's based off the current linear units.. it keeps looking tiny.. but my min/max frame, time , linear unit, and angle do not get set. I get no errors; nothing simply happens

this is my sceneSetup file code:

CODE
    print "Doing sceneSetup. \n";

    //--    1)
            global string $gChannelBoxName;
            channelBox -e -precision 5 $gChannelBoxName;
    //-- 2)
            //currentUnit -linear "m" -angle "degree" -time ntsc;
            currentUnit -linear m;
            currentUnit -angle degree;
            currentUnit -time ntsc;
            playbackOptions -min 0;
            playbackOptions -max 30;
            playbackOptions -playbackSpeed 30;
            autoKeyframe -state 1;
    //-- 3)
            grid -toggle 1 -size 10 -spacing 1 -divisions 1 -displayAxes 1 -displayGridLines 1 -displayDivisionLines 0 -displayPerspectiveLabels 0 -displayAxesBold 1 -orthographicLabelPosition "edge";
    //-- 4)
            //windowCrusher(1);
    //--**
            // Set Clip Planes on all Cameras
            setAttr perspShape.farClipPlane 10000;
            setAttr sideShape.farClipPlane 10000;
            setAttr frontShape.farClipPlane 10000;
            setAttr topShape.farClipPlane 10000;

    print "sceneSetup Done.\n";

note: I sourced sceneSetup after Maya had completely loaded and it worked perfectly. It just doesnt seem to work when launched either in or from userSetup

QUOTE(kurokawa @ 09/26/08, 07:48 AM) [snapback]292354[/snapback]
userSetup

It wont user setup is run THEN the scene is cleared, so you shoudl prbably hook that up to scriptjob that works on scene new.

By the way never change the linear unit its not worth it your end uop destroying all dybamics for a attribute thet does not affect anything in the scale of the scene. truly think of the linear unit as unitless.

CODE
scriptJob -event PreFileNewOrOpened "eval(\"source \"C:/Projects/Maya Projects/MAYASMA/sceneSetup.mel\")";

So I realize that the PreFileNewOrOpened event actually needs to be NewScene. The problem I'm having is that Maya keeps throwing a syntax error; and the associated lines are less than useful : " Syntax error: // "

Was curious if anyone saw anything wrong with this?

Keeping the linear units to a cm is fine. However, I want to change my time unit to ntsc. I have a script job in my userSetup.mel file that reads:

CODE
scriptJob -runOnce true -event PreFileNewOrOpened  sceneSetup;

I then have a sceneSetup.mel file that includes code such as:
CODE
currentUnit -angle degree;
currentUnit -time ntsc;
playbackOptions -min 0;
playbackOptions -max 30;
currentTime 0;
playbackOptions -playbackSpeed 30;
autoKeyframe -state 1;

However, none of these settings appear to be set. I have test text that tells me the procedure is getting called.

[edit] Oh, and my test text indicates that the sceneSetup is getting called before the file -f -new. I thought script jobs got called after the new file command. ( I have also tried events: NewSceneOpened and SceneOpened; but with no luck

try evalDefered

And event on file new. And not just once because if somebody news the scene you want it set.