If this could be useful for someone else, I found a solution to my problem by saving the components dimentions, using get_param function.
In particular Position(3)-Position(1) for the width and Position(4)-Position(2) for the height, then arrange the scheme with arrangeSystem function and finally resize the blocks to the original dimensions and keeping them centered to the new position.
It's not good but it works for now.
If anyone knows a better way to do this let me know
% Get a list of all the blocks in the model
blocks = find_system('myModel', 'SearchDepth', 1, 'Type', 'Block');
% Get dimension for each block (here the variables Width and Height overwrite at every loop iteration)
for i = 1 : length(blocks)
currentBlock = blocks{i};
BlockPosition = get_param(currentBlock, 'Position');
blockWidth = BlockPosition(3)-BlockPosition(1);
blockHeight = BlockPosition(4)-BlockPosition(1);
end
Simulink.BlockDiagram.arrangeSystem('myModel')
% Resize the blocks keeping them centered with the new position
newBlockPosition = get_param(currentBlock, 'Position');
newBlockPosition(1) = newBlockPosition(1) + (newBlockPosition(3)-newBlockPosition(1)-blockWidth)/2;
newBlockPosition(2) = newBlockPosition(2) + (newBlockPosition(4)-newBlockPosition(2)-blockHeight)/2;
newBlockPosition(3) = newBlockPosition(1) + blockeWidth;
newBlockPosition(4) = newBlockPosition(2) + blockHeight;
set_param(currentBlock, 'Position', newBlockPosition);
