Open 3DS Max -> Hierarchy -> Affect Pivot Only -> Center to Object.
Export.
EDIT: It takes 3.4 seconds to do it in 3DS Max. Why do you want to code it and take much more time? are you unable to open the files (perhaps they are already in .b3d format)?
Export.
EDIT: It takes 3.4 seconds to do it in 3DS Max. Why do you want to code it and take much more time? are you unable to open the files (perhaps they are already in .b3d format)?