Substrack interior surfaces or unselect for calculating formwork

Hello everybody, i am trying to write a script to calculate areas to concrete formworks. I saw in some topics this dynamo’s structure but they calculate interior surfaces too, so i need your help to select only the surfaces that is not in contact with another element (Exterior), or a way to unselect manually this surfaces.