How to resize crop view region to assembly elements of Assembly 3D view?

many thanks I tried but result is identical than the previous code. Here you see the difference after running the script and after reset the 3d view to Model.

I tried to feed the code just with one element of the assembly and crop region gets resized but view does not fit anyway, too much white space in between.
Assembly3dview_weird

I did a test to get all the elements bounding box and convert to cuboid to visualise their sizes and I am surprised one family generates huge bounding box but the geometry is quite small, it is a pipe fitting. I edited the family and reduced the extension of the reference planes because I read in other post in this forum that it affects to the assembly views crop box but nothing changed Crop Region automatically fit visible elements - #2 by MJB-online. Here a screen shot that shows the size of bounding boxes, I would like to know how to fix that because I think it is the only thing to do.


image

my conclusion is that the view fits to the bounding boxes of the elements in the view, I removed from assembly those weird families with big bounding boxes and it works as expected now, but how can I prevent this happen? how do I know if the bounding boxes of the elements are crazy?

Assembly3dview_weird2