# Centering model with CuraEngine when creating g-code?

How can I center a model at the middle of the printing area of the printer when creating a g-code with CuraEngine.

Are there any parameters I can add to ultimaker2.def.json to achieve this? Thanks.

Found a solution. This need to be applied under "settings"

"command_line_settings": {
"label": "Command Line Settings",
"description": "Settings which are only used if CuraEngine isn't called from the Cura frontend.",
"type": "category",
"enabled": true,
"children": {
"center_object": {
"description": "Whether to center the object on the middle of the build platform (0,0), instead of using the coordinate system in which the object was saved.",
"type": "bool",
"label": "Center object",
"default_value": true,
"enabled": true
}
}
}


If this is over the commandline tool "CuraEngine", then you will have to read the sourcecode. According to the Author, 'Nope. Only documentation there is in the code, readme and my head.' (cringe!).

If you're talking of the GUI program, then right click and click "Center". But this requires GUI usage. Not so nice if you want to automate using curaengine as your slicer.