The internal or external attribute of building information modeling (BIM) objects is vital information for many BIM‐based engineering analyses such as building energy analysis and cost estimation. Unfortunately, such information is often inaccurate, incomplete, or missing entirely in most BIM models. Manually checking, correcting, or inputting this data for large‐scale BIM models can be time‐consuming, laborious, and error‐prone. This study proposes a two‐stage ray tracing algorithm to automatically identify external BIM objects, based on the idea that external objects of a building can be viewed from somewhere outside the building. The first‐stage ray tracing samples viewpoints from the six faces of an offset axis‐aligned bounding box (AABB) of the building and emits a ray for each viewpoint to detect relevant external objects. The second‐stage ray tracing recursively searches for any remaining external objects from the view of the external objects that have been detected in the previous round of ray tracing. Both stages are carefully designed for efficiency. Furthermore, a two‐tier AABB tree is introduced to spatially index building objects on both model and object levels to accelerate relevant geometry operations. The proposed algorithm is validated with one synthetic and two large‐scale real‐world building models. The results show that all the external objects in the three models are accurately and efficiently identified, and the two‐tier spatial indexing and other acceleration techniques improve the algorithm's efficiency significantly.