You can do it like this:
import rhinoscriptsyntax as rs
from math import *
l = 40 # building length in m
w = 30 # building width in m
pH = 0.4 # parapet height in m
pW = 0.3 # parapet width in m
h = 10 + pH # roof height in m
#Addbox building
p1 = (-l/2,-w/2,0)
p2 = (l/2, -w/2,0)
p3 = (l/2, w/2,0)
p4 = (-l/2, w/2,0)
p5 = (-l/2,-w/2,h)
p6 = (l/2, -w/2,h)
p7 = (l/2, w/2,h)
p8 = (-l/2, w/2,h)
building = rs.AddBox([p1,p2,p3,p4,p5,p6,p7,p8])
#Addbox parapet
pp1 = (-l/2 + pW/2,-w/2 + pW/2,h)
pp2 = (l/2 - pW/2, -w/2 + pW/2,h)
pp3 = (l/2 - pW/2, w/2 - pW/2,h)
pp4 = (-l/2 + pW/2, w/2 - pW/2,h)
pp5 = (-l/2 + pW/2,-w/2 + pW/2,h-pH)
pp6 = (l/2 - pW/2, -w/2 + pW/2,h-pH)
pp7 = (l/2 - pW/2, w/2 - pW/2,h-pH)
pp8 = (-l/2 + pW/2, w/2 - pW/2,h-pH)
parapet = rs.AddBox([pp1,pp2,pp3,pp4,pp5,pp6,pp7,pp8])
#Addbox enclosure
pe1 = (-l/2 - 5*h, -w/2 - 5*h,0)
pe2 = (l/2 + 10*h, -w/2 - 5*h,0)
pe3 = (l/2 + 10*h, w/2 + 5*h,0)
pe4 = (-l/2 - 5*h, w/2 + 5*h,0)
pe5 = (-l/2 - 5*h, -w/2 - 5*h,6*h)
pe6 = (l/2 + 10*h, -w/2 - 5*h,6*h)
pe7 = (l/2 + 10*h, w/2 + 5*h,6*h)
pe8 = (-l/2 - 5*h, w/2 + 5*h,6*h)
enclosure = rs.AddBox([pe1,pe2,pe3,pe4,pe5,pe6,pe7,pe8])
# b = rs.GetObject("building")
# enc = rs.GetObject("enclosure")
# par =rs.GetObject("parapet")
bool_1 = rs.BooleanDifference(building, parapet)
bool_2 = rs.BooleanDifference(enclosure, bool_1)