Hello,
The only correct way is to get the 3D body (bodies) of the enclosing wall, and calculate it, because of the huge number of parameters that affect the body generation. Please use the code shown in the ModelAccess_Test example for that. The 3D window/database has to be active, though.
Best, Akos