BIM Controller
Building Information Modeling (BIM) workflows.
Covers the IFC ecosystem and the building-structural metadata that goes with it: IFC import/export in its supported schema versions, configuration of IFC export options (properties, project data, aggregation, element combination), and assignment of building and storey information to elements. The module to use whenever the model needs to interoperate with IFC-based BIM tooling.
convert_exchange_objects(exchange_objects: list[ElementId]) -> list[ElementId]
Converts a list of Exchange Objects to Cadwork Elements.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
exchange_objects
|
list[ElementId]
|
A list of Exchange Object id to convert. |
required |
Returns:
| Type | Description |
|---|---|
list[ElementId]
|
The list of Cadwork Element ids. |
export_bcf(file_path: str) -> bool
Exports a BCF file.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
file_path
|
str
|
The path where the BCF file will be exported. |
required |
Examples:
1 | |
1 2 3 4 | |
Returns:
| Type | Description |
|---|---|
bool
|
True if the export was successful, false otherwise. |
export_ifc(element_id_list: list[ElementId], file_path: str) -> bool
Export IFC file.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
element_id_list
|
list[ElementId]
|
The list of element ids. |
required |
file_path
|
str
|
The path where the IFC file will be exported. |
required |
Examples:
1 2 | |
1 2 3 4 5 | |
Returns:
| Type | Description |
|---|---|
bool
|
True if the export was successful, false otherwise. |
export_ifc2x3_silently(element_id_list: list[ElementId], file_path: str) -> bool
Export IFC2x3 silently.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
element_id_list
|
list[ElementId]
|
The list of element ids. |
required |
file_path
|
str
|
The path where the IFC file will be exported. |
required |
Returns:
| Type | Description |
|---|---|
bool
|
True if the export was successful, false otherwise. |
export_ifc2x3_silently_with_options(element_id_list: list[ElementId], file_path: str, options: ifc_options) -> bool
Exports IFC2x3 silently with options.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
element_id_list
|
list[ElementId]
|
The list of element ids. |
required |
file_path
|
str
|
The path where the IFC file will be exported. |
required |
options
|
ifc_options
|
The export options. |
required |
Returns:
| Type | Description |
|---|---|
bool
|
True if the export was successful, false otherwise. |
export_ifc4_silently(element_id_list: list[ElementId], file_path: str) -> bool
Exports IFC4 silently.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
element_id_list
|
list[ElementId]
|
The list of element ids. |
required |
file_path
|
str
|
The path where the IFC file will be exported. |
required |
Returns:
| Type | Description |
|---|---|
bool
|
True if the export was successful, false otherwise. |
export_ifc4_silently_with_options(element_id_list: list[ElementId], file_path: str, options: ifc_options) -> bool
Exports IFC4 silently with options.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
element_id_list
|
list[ElementId]
|
The list of element ids. |
required |
file_path
|
str
|
The path where the IFC file will be exported. |
required |
options
|
ifc_options
|
The export options. |
required |
Returns:
| Type | Description |
|---|---|
bool
|
True if the export was successful, false otherwise. |
get_all_buildings() -> list[str]
Get all buildings.
Returns:
| Type | Description |
|---|---|
list[str]
|
A list of all building. |
get_all_storeys(building: str) -> list[str]
Get all storeys.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
building
|
str
|
The building name. |
required |
Returns:
| Type | Description |
|---|---|
list[str]
|
A list of all storeys in the building. |
get_building(element_id: ElementId) -> str
Get building name for a given element.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
element_id
|
ElementId
|
The element id. |
required |
Returns:
| Type | Description |
|---|---|
str
|
The name of the building. |
get_element_id_from_base64_ifc_guid(base_64_ifc_guid: str) -> ElementId
Get element id from base64 ifc guid.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
base_64_ifc_guid
|
str
|
The base64 IFC GUID. |
required |
Returns:
| Type | Description |
|---|---|
ElementId
|
The element id corresponding to the base64 IFC GUID. |
get_ifc2x3_element_type(element_id: ElementId) -> ifc_2x3_element_type
Get ifc2x3 element type.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
element_id
|
ElementId
|
The element id. |
required |
Examples:
1 2 3 | |
1 2 3 | |
Returns:
| Type | Description |
|---|---|
ifc_2x3_element_type
|
The ifc_2x3_element_type of the element. |
get_ifc2x3_element_type_display_string(entity_type: ifc_2x3_element_type) -> str
Get IFC2x3 element type display string.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
entity_type
|
ifc_2x3_element_type
|
The entity type. |
required |
Returns:
| Type | Description |
|---|---|
str
|
The display string representation of the IFC2x3 element type. |
get_ifc2x3_element_type_string(entity_type: ifc_2x3_element_type) -> str
Get IFC2x3 element type string.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
entity_type
|
ifc_2x3_element_type
|
The entity type. |
required |
Returns:
| Type | Description |
|---|---|
str
|
The string representation of the IFC2x3 element type. |
get_ifc_base64_guid(element_id: ElementId) -> str
Get IFC base64 Guid from element id.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
element_id
|
ElementId
|
The element id. |
required |
Returns:
| Type | Description |
|---|---|
str
|
The IFC GUID in base64 string format ("28kif20KPEuBjk2m1N3ep$"). |
get_ifc_guid(element_id: ElementId) -> str
Get the IFC GUID of an element.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
element_id
|
ElementId
|
The element id. |
required |
Examples:
1 2 | |
1 2 3 4 | |
Returns:
| Type | Description |
|---|---|
str
|
A string representing the IFC GUID. |
get_ifc_options() -> ifc_options
Get the IfcOptions with the settings used in the document.
Returns:
| Type | Description |
|---|---|
ifc_options
|
The IfcOptions object containing the current settings. |
get_ifc_predefined_type(element_id: ElementId) -> ifc_predefined_type
Get the IfcPredefinedType of an element.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
element_id
|
ElementId
|
The element id. |
required |
Returns:
| Type | Description |
|---|---|
ifc_predefined_type
|
The IfcPredefinedType of the element. |
get_storey(element_id: ElementId) -> str
Get storey name for a given element.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
element_id
|
ElementId
|
The element id. |
required |
Returns:
| Type | Description |
|---|---|
str
|
The name of the storey. |
get_storey_height(building: str, storey: str) -> float
Get storey height for a given building and storey.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
building
|
str
|
The building name. |
required |
storey
|
str
|
The storey name. |
required |
Returns:
| Type | Description |
|---|---|
float
|
The height of the storey. |
import_bcf(file_path: str) -> bool
Imports a BCF file.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
file_path
|
str
|
The path to the BCF file. |
required |
Examples:
1 | |
1 2 3 4 | |
Returns:
| Type | Description |
|---|---|
bool
|
True if the import was successful, false otherwise. |
import_ifc_as_graphical_object(file_path: str) -> bool
Imports ifc as graphical object.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
file_path
|
str
|
The path to the IFC file. |
required |
Examples:
1 | |
1 2 3 4 | |
Returns:
| Type | Description |
|---|---|
bool
|
True if the import was successful, false otherwise. |
import_ifc_return_exchange_objects(file_path: str) -> list[ElementId]
Imports an IFC File and returns the ids of the Exchange Objects.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
file_path
|
str
|
The path to the IFC file. |
required |
Returns:
| Type | Description |
|---|---|
list[ElementId]
|
The ids of the exchange objects. |
set_building_and_storey(element_id_list: list[ElementId], building: str, storey: str) -> None
Set building and storey.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
element_id_list
|
list[ElementId]
|
The list of element ids. |
required |
building
|
str
|
The building name. |
required |
storey
|
str
|
The storey name. |
required |
Examples:
1 2 | |
1 2 3 4 | |
set_ifc2x3_element_type(element_id_list: list[ElementId], ifc_type: ifc_2x3_element_type) -> None
Set ifc2x3 element type.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
element_id_list
|
list[ElementId]
|
The list of element ids. |
required |
ifc_type
|
ifc_2x3_element_type
|
The ifc_2x3_element_type to set. |
required |
Examples:
1 2 3 | |
1 2 3 4 | |
set_ifc_predefined_type(element_id_list: list[ElementId], predefined_type: ifc_predefined_type) -> None
Set a predefined type to elements. Attention, if you change the PredefinedType of the elements, you are responsible for ensuring that valid types are set.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
element_id_list
|
list[ElementId]
|
The list of element ids. |
required |
predefined_type
|
ifc_predefined_type
|
The predefined type to set. |
required |
Examples:
1 2 3 | |
1 2 3 4 | |
set_storey_height(building: str, storey: str, height: float) -> None
Set storey height.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
building
|
str
|
The name of the building. |
required |
storey
|
str
|
The name of the storey. |
required |
height
|
float
|
The height of the storey. |
required |
Examples:
1 | |
1 2 3 4 | |
update_bmt_structure_building_storey(element_id_list: list[ElementId]) -> None
This function takes the specified elements and inserts them into the BMT structure and adds them to the assigned Building and Storey.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
element_id_list
|
list[ElementId]
|
The list of element ids to be updated in the BMT structure. |
required |
update_bmt_structure_created_elements(element_id_list: list[ElementId]) -> None
This function takes the specified elements and inserts them into the BMT structure and adds them to the active building and storey.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
element_id_list
|
list[ElementId]
|
The list of element ids to be updated in the BMT structure. |
required |