A knowledge model-based BIM framework for automatic code-compliant quantity take-off