Skip to content

Configuration

ifc-graph can be configured through environment variables, configuration files, and CLI arguments.

Environment Variables

Create a .env file in your project root:

# Neo4j Connection
NEO4J_URI=bolt://localhost:7687
NEO4J_USER=neo4j
NEO4J_PASSWORD=your_password_here

# Default IFC file path
IFC_FILE_PATH=./model.ifc

Available Environment Variables

Variable Description Default
NEO4J_URI Neo4j connection URI bolt://localhost:7687
NEO4J_USER Neo4j username neo4j
NEO4J_PASSWORD Neo4j password (required)
IFC_FILE_PATH Default IFC file path (none)

Configuration File

Create a config.yaml file to customize extraction settings:

# Element types to extract from IFC files
element_types:
  - IfcWall
  - IfcWallStandardCase
  - IfcDoor
  - IfcWindow
  - IfcColumn
  - IfcBeam
  - IfcSlab
  - IfcStair
  - IfcRamp
  - IfcRoof
  - IfcCurtainWall
  - IfcPlate
  - IfcMember
  - IfcRailing
  - IfcFurniture
  - IfcBuildingElementProxy

# Extraction options
extraction:
  include_property_sets: true
  include_materials: true
  max_properties_per_element: 50

Supported Element Types

ifc-graph can extract any IFC element type. Common types include:

Structural Elements

  • IfcWall, IfcWallStandardCase
  • IfcColumn
  • IfcBeam
  • IfcSlab
  • IfcFooting
  • IfcPile

Architectural Elements

  • IfcDoor
  • IfcWindow
  • IfcStair, IfcStairFlight
  • IfcRamp, IfcRampFlight
  • IfcRoof
  • IfcCurtainWall
  • IfcRailing

MEP Elements

  • IfcFlowTerminal
  • IfcFlowSegment
  • IfcFlowFitting
  • IfcDistributionElement

Furniture & Equipment

  • IfcFurniture
  • IfcFurnishingElement
  • IfcBuildingElementProxy

Extraction Options

Option Type Description
include_property_sets boolean Extract property sets for each element
include_materials boolean Extract material information
max_properties_per_element integer Limit properties per element (performance)

CLI Arguments

CLI arguments override environment variables and config file settings:

ifc-graph \
  --ifc-file model.ifc \
  --config custom_config.yaml \
  --neo4j-uri bolt://production:7687 \
  --neo4j-user admin \
  --neo4j-password secret \
  --clear-db \
  --log-level DEBUG

Configuration Priority

Settings are applied in this order (later overrides earlier):

  1. Default values - Built-in defaults
  2. Environment variables - From .env file
  3. Configuration file - From config.yaml
  4. CLI arguments - Command-line options

Example Configurations

Minimal Configuration (Structural Only)

element_types:
  - IfcWall
  - IfcColumn
  - IfcBeam
  - IfcSlab
  - IfcFooting

Full Building Model

element_types:
  # Structural
  - IfcWall
  - IfcWallStandardCase
  - IfcColumn
  - IfcBeam
  - IfcSlab
  - IfcFooting
  - IfcPile
  # Architectural
  - IfcDoor
  - IfcWindow
  - IfcStair
  - IfcStairFlight
  - IfcRamp
  - IfcRoof
  - IfcCurtainWall
  - IfcRailing
  # Openings
  - IfcOpeningElement
  # Other
  - IfcBuildingElementProxy

extraction:
  include_property_sets: true
  include_materials: true
  max_properties_per_element: 100

MEP Focus

element_types:
  - IfcFlowTerminal
  - IfcFlowSegment
  - IfcFlowFitting
  - IfcFlowController
  - IfcDistributionElement
  - IfcDistributionFlowElement
  - IfcPipeSegment
  - IfcPipeFitting
  - IfcDuctSegment
  - IfcDuctFitting
  - IfcCableSegment

Validating Configuration

Use dry-run mode to validate your configuration without making database changes:

ifc-graph --ifc-file model.ifc --config config.yaml --dry-run

This will show which elements would be extracted with your current settings.