Module Contents#

class ifcpatch.recipes.RegenerateGlobalIds.Patcher(src, file, logger, only_duplicates=False)#

Regenerate GlobalIds in an IFC model

All root elements in an IFC model must be identified by a unique Global ID (also known as a GUID or UUID). Some proprietary BIM software do this incorrect (I know right), either by generating an invalid ID, creating duplicate IDs, generating IDs in a way that is not universally unique or as random as you might prefer (e.g. non-compliant with UUID v4).

This will regenerate new GlobalIds for the entire model.


only_duplicates (bool) – If set to True, new GlobalIds will only be generated for duplicate IDs. This is a safe thing to run to ensure IFCs are valid. If False, all GlobalIds will be regenerated.


# Regenerate all GlobalIds
ifcpatch.execute({"input": "input.ifc", "file": model, "recipe": "RegenerateGlobalIds", "arguments": []})

# Regenerate only duplicate GlobalIds
ifcpatch.execute({"input": "input.ifc", "file": model, "recipe": "RegenerateGlobalIds", "arguments": [True]})