Skip to content

This script extracts the width, length, and height of each element of type "IfcColumn". (gives the same results as BIM viewers)

Notifications You must be signed in to change notification settings

alabonn/IFC-Column-Dimensions-Extractor

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 

Repository files navigation

IFC Column Dimension Extractor

This script extracts the width, length, and height of each IfcColumn by generating its mesh using IfcOpenShell.geom. Instead of relying on IFC parameters such as XDim, YDim, or ZDim, it computes dimensions directly from the bounding box derived from the column’s geometry. To ensure consistent processing, all raw IFC geometries are unified into a mesh representation. This standardization resolves inconsistencies across different geometric formats, such as extrusions, sweeps, and mesh-based models.

As a result, the script remains effective even when explicit dimensions are missing or when the column’s shape cannot be obtained from predefined IFC properties.

How it works

  • Loads the IFC file and enables world-coordinate geometry extraction.
  • Iterates through all IfcColumn elements in the model.

For each column:

  • Creates a mesh geometry using ifcopenshell.geom.create_shape().

  • Extracts all vertex coordinates of the mesh.

  • Computes the minimum and maximum XYZ values.

  • Calculates a geometric bounding box as:

    • width → the smaller side of the column
    • length → the larger side of the column
    • height → the Z extent
      (Note: if you are dealing with circular columns, you can replace the width variable to diameter since it has the same process as tested)
  • Converts all values from meters (m) to millimeters (mm).
    (Note: ifcopenshell.geom always outputs geometry in meters regardless of IFC project units.)

  • Prints the extracted dimensions.

  • Saves the results into a CSV file named columns_output.csv with columns:
    ["GlobalId", "Width_mm", "Length_mm", "Height_mm"].

About

This script extracts the width, length, and height of each element of type "IfcColumn". (gives the same results as BIM viewers)

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages