Is there a centre command to centre one object within another?

is there a command to centre an object (cube) within another object ?

I am creating cubes for internal and external box sizes entering length then width then height, it would be great to run a command and have the internal cube centred on the external cube.


In one viewport use Align with Concentric option
In a second viewport orthogonal to the first repeat Align with Concentric option

Thanks, any way of keeping the outer box in its original location ?


Use VolumeCentroid to create a point at the center of the outer box before using Align. Then Align with alignment to the volume centroid point.