[MAX SCRIPT] creating grid helpers - script units != max units?

New to Max Script.

our game levels will use a tile based layout system, each tile is 1.5 meters
the artists are working with Max’s Home Grid grid spacing set to meters

I am trying to write a script to generate a “tile grid” grid helper
with 1.5 m cels and a .75m offset ( so objects at 0,0,0 are centered on a tile.)
but the units in max script do not appear to be understood by Max as meters.

tileGrid =grid name:"tile_grid" length:50 width:50 gridFloat:1.5 position:[0.75,0.75,0]
activeGrid=tileGrid

generates something completely unexpected in size, a grid that is 1.27 x 1.27m with 0.254m spacing, offset by 0.019m

If I watch the macro recorder while tweaking the parameters in the modify panel to be what I want ( length and with 50x50, spacing 1.75)
I get some unexpected results:

$.length = 1968.5
$.width = 1968.5
$.grid = 59.0551

It appears that the units in max script are not the same as units in the home grid?
what’s going on here?

Any insight into what is happening?

Your max scene is set to inches, I think. Look at the documentation for the Units struct:

http://docs.autodesk.com/3DSMAX/14/ENU/MAXScript%20Help%202012/index.html?url=files/GUID-DB50F450-C3D1-47A5-98A2-A3460171003-1997.htm,topicNumber=d28e671230

You probably want to set the scene to meters with

units.DisplayType = #Metric
units.MetricType = #Meters

but it’s been a while since I looked at this

Thanks, just the info i needed!