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.aggregate
ifcopenshell.api.attribute
ifcopenshell.api.boundary
ifcopenshell.api.classification
ifcopenshell.api.constraint
ifcopenshell.api.context
ifcopenshell.api.control
ifcopenshell.api.cost
ifcopenshell.api.document
ifcopenshell.api.drawing
ifcopenshell.api.geometry
ifcopenshell.api.georeference
ifcopenshell.api.grid
ifcopenshell.api.group
ifcopenshell.api.layer
ifcopenshell.api.library
ifcopenshell.api.material
ifcopenshell.api.nest
ifcopenshell.api.owner
ifcopenshell.api.profile
ifcopenshell.api.project
ifcopenshell.api.pset
ifcopenshell.api.pset_template
ifcopenshell.api.resource
ifcopenshell.api.root
ifcopenshell.api.sequence
ifcopenshell.api.spatial
ifcopenshell.api.structural
ifcopenshell.api.style
ifcopenshell.api.system
ifcopenshell.api.type
ifcopenshell.api.unit
ifcopenshell.api.void
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, usecase)¶
- 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 ¶
- 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]¶