ifcopenshell.api.project.create_file#

Module Contents#

class ifcopenshell.api.project.create_file.Usecase(version: str = 'IFC4')#

Create a blank IFC model file object

Create a new IFC file object based on the nominated schema version. The schema version you choose determines what type of IFC data you can store in this model. The file is blank and contains no entities.

It also sets up header data for STEP file serialisation, such as the current timestamp, IfcOpenShell as the preprocessor, and defaults to a DesignTransferView MVD.

Parameters

version (str, optional) – The schema version of the IFC file. Choose from “IFC2X3”, “IFC4”, or “IFC4X3”. If you have loaded in a custom schema, you may specify that schema identifier here too.

Returns

The created IFC file object.

Return type

ifcopenshell.file.file

Example:

# Start a new model.
model = ifcopenshell.api.run("project.create_file")

# It's currently a blank model, so typically the first thing we do
# is create a project in it.
project = ifcopenshell.api.run("root.create_entity", model, ifc_class="IfcProject", name="Test")

# ... and off we go!
execute(self) ifcopenshell.file#