Filter the ifcJSON Model
Feature Group(s): Filter | Pandas
Submit the processing request
#
# Filter an IFCJSON
#
class FilterIfcJson_Instruction(BaseModel):
sourceFileURL: str | None = "http://localhost:8002/IFCJSON/597e4482-c5ab-4f8d-a02b-e7db99a14a37_NI.json"
filter: IfcJsonFilter
class IfcJsonFilter(BaseModel):
categoryList: list[Literal['construction','furniture','group','material','ownership','project','propertySet','quantity','relationship','representation','space','system']] | None = ['construction','group','material','ownership','project','propertySet','quantity','relationship','representation','space']
excludeTypeList: list[str] | None = ['IfcBuildingElement','IfcBuildingElementPart','IfcBuildingElementProxy','IfcBuildingElementProxyType']
class FilterIfcJson_Result(BaseModel):
resultPath: str # relative path of the result file (json)
runtime: float | None = 0.0 # in seconds
Filter the IfcJSON
Filtering the content of an IFC helps to provide a focused information set that is relevant for a specific administrative use case.
A Digital Building Permit will e.g., not need the information for all illustrative furnitures placed in the IfcSpaces. Details on ventilation systems may be relevant or not. Connectedness of walls may be superfluous or not.
There are 876 IfcEntities in the spec IFC 4.3.2 Annex B Alphabetical listings - Entities. Which is a lot!
There a two ways to filter:
- Extraction: select the Elements that we want to keep. This can be done directly on the IFC model with IfcPatch by applying an 'ExtractElements' recipe. This is both efficient and convenient if the list of elements that we want to keep is limited. Extraction with IfcPatch is illutrated in a separate section (Extract Elements from the IFC model).
- Filtering out elements that are not needed: this is relatively complex and is the object of this section.
We propose a two-fold approach:
- Association of categories (such as 'construction', 'system', ...) to individual entities. This is defined in the csv under /db/csv/ifc-types-ref.csv. The filter will give the categories that are retained
- With a given category, some IfcEntities might be superfluous for the use case, so they can be excluded.
The filtering is done by loading the ifcJSON in pandas Dataframes and/or Series, as they provide convenient capabilities.
Filtering the elements is not enough. It is critial to ensure that there are no references left to elements that have been filtered out.
There are also the relationships that link a relating element (the ''parent'') to a list of related elements (the ''children''). If a ''child'' is removed, it needs to be pruned from the list of related elements. If a ''parent'' loses all its ''children'', it needs to be removed.
The relating and related elements are named differently for the many types of relationships. Therefore, there is a csv (in /db/csv/ifc-relationships-ref.csv) that documents, for each relationship type, the names that must be used for the ''relating'' and the ''related'' elements.
The processing is then straightforward:
- Filter the model
- Split de list of entities is 4 groups (following the proposed Physical Table Model):
- Representations
- PropertySets
- Relationships
- Objects: all entities that are not in one of the 3 others
- Drop representations that are not related to objects retained in the model
- Prune the related members in the relationships; if there is no related left, then:
- if the relating is a property_set: drop the property_set
- in all cases: drop the relationship
At the end, the filtered model is saved as an ifcJSON.