ifcopenshell.api¶
High level IFC authoring and editing functions
Authoring, editing, and deleting IFC data requires a detailed understanding of the rules of the IFC schema. This API module provides simple to use authoring functions that hide this complexity from you. Things like managing differences between IFC versions, tracking owernship changes, or cleaning up after orphaned relationships are all handled automatically.
If you’re new to IFC authoring, start by looking at the following APIs:
See
ifcopenshell.api.project.create_file()to create a new IFC.See
ifcopenshell.api.root.create_entity()to create new entities, like the mandatory IfcProject, and then an IfcSite, IfcWall, etc.See
ifcopenshell.api.aggregate.assign_object()to create a spatial hierarchy.See
ifcopenshell.api.spatial.assign_container()to place physical elements (e.g. walls) inside spatial elements (e.g. building storeys).
Also see how to create a simple model from scratch.
Subpackages¶
ifcopenshell.api.aggregateifcopenshell.api.alignmentifcopenshell.api.attributeifcopenshell.api.boundaryifcopenshell.api.classificationifcopenshell.api.cogoifcopenshell.api.constraintifcopenshell.api.contextifcopenshell.api.controlifcopenshell.api.costifcopenshell.api.documentifcopenshell.api.drawingifcopenshell.api.featureifcopenshell.api.geometryifcopenshell.api.georeferenceifcopenshell.api.gridifcopenshell.api.groupifcopenshell.api.layerifcopenshell.api.libraryifcopenshell.api.materialifcopenshell.api.nestifcopenshell.api.ownerifcopenshell.api.profileifcopenshell.api.projectifcopenshell.api.psetifcopenshell.api.pset_templateifcopenshell.api.resourceifcopenshell.api.rootifcopenshell.api.sequenceifcopenshell.api.spatialifcopenshell.api.structuralifcopenshell.api.styleifcopenshell.api.systemifcopenshell.api.typeifcopenshell.api.unit
Package Contents¶
- ifcopenshell.api.add_post_listener(usecase_path: str, name: str, callback: Callable[[str, ifcopenshell.file, dict], None]) None¶
Add a post listener
- Parameters:
usecase_path – string, ifcopenshell api use case path
name – string, name of listener
callback – callback function with 3 arguments: usecase_path, ifc_file, settings
- ifcopenshell.api.add_pre_listener(usecase_path: str, name: str, callback: Callable[[str, ifcopenshell.file, dict], None]) None¶
Add a pre listener
- Parameters:
usecase_path – string, ifcopenshell api use case path
name – string, name of listener
callback – callback function with 3 arguments: usecase_path, ifc_file, settings
- ifcopenshell.api.extract_docs(module: str, usecase: str) dict[str, Any]¶
- ifcopenshell.api.remove_all_listeners()¶
- ifcopenshell.api.remove_post_listener(usecase_path: str, name: str, callback: Callable[[str, ifcopenshell.file, dict], None]) None¶
Remove a post listener
- Parameters:
usecase_path – string, ifcopenshell api use case path
name – string, name of listener
callback – callback function with 3 arguments: usecase_path, ifc_file, settings
- ifcopenshell.api.remove_pre_listener(usecase_path: str, name: str, callback: Callable[[str, ifcopenshell.file, dict], None]) None¶
Remove a pre listener
- Parameters:
usecase_path – string, ifcopenshell api use case path
name – string, name of listener
callback – callback function with 3 arguments: usecase_path, ifc_file, settings
- ifcopenshell.api.renamed_arguments_deprecation(usecase_path: str, settings: dict, arguments_remapped: dict[str, str]) tuple[str, dict]¶
- ifcopenshell.api.run(usecase_path: str, ifc_file: ifcopenshell.file | None = None, should_run_listeners: bool = True, **settings: Any) Any¶
This is deprecated and will be removed in a future version. Do not use this function.
- ifcopenshell.api.serialise_settings(settings)¶
- ifcopenshell.api.wrap_usecase(usecase_path, usecase)¶
Wraps an API function in pre/post listeners.
- ifcopenshell.api.wrap_usecases(path, name)¶
This developer feature wraps an API module’s usecases with listeners.
- ifcopenshell.api.ARGUMENTS_DEPRECATION: dict[str, Callable[[str, dict[str, Any]], tuple[str, dict[str, Any]]]]¶
- ifcopenshell.api.CACHED_USECASES: dict[str, Callable]¶
- ifcopenshell.api.CACHED_USECASE_CLASSES: dict[str, Callable]¶
- ifcopenshell.api.post_listeners: dict[str, dict]¶
- ifcopenshell.api.pre_listeners: dict[str, dict]¶