Model
- class compas_ifc.model.Model(filepath=None, schema='IFC4', use_occ=False, load_geometries=True, verbose=True, extensions=None)
Bases:
Data
The Model class is the COMPAS IFC’s main entry point. It is a intuitive abstraction on top of an IFC file, providing a set of easy-to-use methods for interacting with the IFC data.
- Attributes:
- file
compas_ifc.file.IFCFile
The IFC file object.
- schema
ifcopenshell.schema.Schema
The IFC schema object.
- schema_namestr
The name of the IFC schema.
- entitiesGenerator[
compas_ifc.entities.base.Base
, None, None] A generator of all entities in the IFC file.
- project
compas_ifc.entities.generated.IFC4.IfcProject
The project entity.
- siteslist[
compas_ifc.entities.generated.IFC4.IfcSite
] A list of all site entities.
- buildingslist[
compas_ifc.entities.generated.IFC4.IfcBuilding
] A list of all building entities.
- building_storeyslist[
compas_ifc.entities.generated.IFC4.IfcBuildingStorey
] A list of all building storey entities.
- building_elementslist[
compas_ifc.entities.generated.IFC4.IfcBuildingElement
] A list of all building element entities.
- unitstr
The unit of the IFC file. Can be “mm”, “cm”, or “m”.
- file
Methods
Construct the Model object.
Create an entity in this model.
Create a beam in this model.
Create a column in this model.
Create a default project in this model if one does not exist.
Create a door in this model.
Create a railing in this model.
Create a roof in this model.
Create a slab in this model.
Create a stair in this model.
Create a wall in this model.
Create a window in this model.
Export a subset of the IFC file to a new IFC file.
Get entities by name
Get entities by type name
Get an entity by global ID
Get an entity by ID
Print the spatial hierarchy of the IFC file.
Print a summary of the IFC file.
Remove an entity from this model.
Save the IFC file.
Search for IFC classes by name
Show the IFC file in a viewer, either the entire project or a single entity.
Create a template model with a default project, site, building, and storey.
Inherited Methods
Converts the instance to a string.
Make an independent copy of the data object.
Construct an object of this type from a JSON file.
Construct an object of this type from a JSON string.
Compute a hash of the data for comparison during version control using the sha256 algorithm.
Convert an object to its native data representation and save it to a JSON file.
Convert an object to its native data representation and save it to a JSON string.
Validate the data against the object's data schema.