Hello nachogi73,
You can rotate the bounding box to align its Z-axis with the coordinate system vertical direction.
I think that the script has been posted somewhere here, but there's no problem to copy it once again:
import PhotoScan, math
doc = PhotoScan.app.document
chunk = doc.activeChunk
if chunk.transform:
T = chunk.transform
else:
T = PhotoScan.Matrix().diag([1,1,1,1])
v = PhotoScan.Vector( [0,0,0,1] )
v_t = T * v
v_t.size = 3
if chunk.crs:
m = chunk.crs.localframe(v_t)
else:
m = PhotoScan.Matrix().diag([1,1,1,1])
m = m * T
s = math.sqrt(m[0,0]*m[0,0] + m[0,1]*m[0,1] + m[0,2]*m[0,2]) #scale factor
R = PhotoScan.Matrix( [[m[0,0],m[0,1],m[0,2]], [m[1,0],m[1,1],m[1,2]], [m[2,0],m[2,1],m[2,2]]])
R = R * (1. / s)
reg = chunk.region
reg.rot = R.t()
chunk.region = reg