Calculating OrthoZoom based on dimensions of an object

I’m trying to calculate the OrthoZoom for a viewport that’s in an Orthographic view. I need the camera to zoom in on an object when i prompt it to do so.

Is there any easy way of doing this? So far I’ve not be able to work out how to calculate the zoom value.

thanks

I’ve found something I can use, FEditorViewportClient::FocusViewportOnBox does exactly what I’m looking for.