Model

class compas_ifc.model.Model(filepath=None, entity_types=None, use_occ=False, schema=None, load_geometries=True)

Bases: object

Class representing an entire IFC model.

Parameters:
filepathstr

The path to the IFC file.

entity_typesdict

A dictionary mapping IFC entity types to corresponding compas_ifc.entities classes. This can be used to customize the classes used to represent IFC entities.

Attributes:
readerIFCReader

The reader used to read the content of an IFC file.

writerIFCWriter

The writer used to write the content of an IFC file.

schemastr

The schema of the IFC file.

projectsList[Project]

The projects contained in the model. Typically there is exactly one.

projectProject

The project of the model.

sitesList[Site]

The sites contained in the model. In a correctly formed hierarchical model, sites are part of a project. If that is not the case, they are also accessible here.

buildingsList[Building]

The buildings contained in the model. In a correctly formed hierarchical model, buildings are part of a site. If that is not the case, they are also accessible here.

building_storeysList[BuildingStorey]

The building storeys contained in the model.

elementsList[BuildingElement]

All the building elements contained in the model. In a correctly formed hierarchical model, building elements are part of a building, building storey, or space. If that is not the case, they are also accessible here.

Methods

__init__

create

Create an entity and add it to the model.

export

export_session

get_all_entities

Get all entities in the model.

get_entities_by_name

Get all entities with a specific name.

get_entities_by_type

Get all entities of a specific ifc type in the model.

get_entity_by_global_id

Get an entity by its global id.

get_entity_by_id

Get an entity by its id in the IFC file.

insert

Insert a geometry into the model.

load_session

open

print_spatial_hierarchy

Print the spatial hierarchy of the model.

print_summary

Print a summary of the model.

save

show

template