IFCPatch tool now available

I problem I usually face is that IFCs exported from proprietary applications have various issues in them. I want to fix them, but most IFC authoring programs do an import-export process that results in a huge amount of data being lost in-between.

To solve this, I usually run a quick Python script which uses IfcOpenShell to modify the IFC file. However this is usually something only I can do but others cannot do in the office. For this reason I made IFCPatch.

Basically, it's a CLI app which you can feed in an IFC file, and apply a "recipe" which will modify the IFC in some predefined manner. For example:

$ ifcpatch -i foo.ifc -r ResetAbsoluteCoordinates

This will detect any IfcCartesianPoint which are placed in absolute coordinates (i.e. very far away) and correct them - which is a common problem in incorrectly geolocated IFCs produced from 12D.

Recipes can also allow arguments to be passed, such as:

$ ifcpatch -i foo.ifc -r OffsetStoreyLocations -a 1000

That will shift up all building stories by 1000 units.

I hope its useful to someone. Being a CLI app, I have integrated it into a Git hook when consultants submit their files.

bitacovirJesusbilledwinguerraberndCGREloyRD

Comments

  • How do I run IfcPatch? If I compile and install latest IfcOpenShell I only have "IfcConvert" and "IfcGeomServer" binaries starting with "Ifc" installed?

    Do you have an exapmple for IfcPatch and ExtractElements ?

  • @bernd IfcPatch is pure Python. See link in first post.

    Example:

    $ ifcpatch -i foo.ifc -o out.ifc -r ExtractElements -a ".IfcWall"
    
  • ok
    In your example you did call ifcpatch out of your bash, but ifcpatch is a directory in ifcopenshell sources. How should I call ifcpatch if there is no python module ifcpatch? There is only a package (directory) named ifcpatch in ifcopenshell sources.

    I seam to miss the forest because of the trees ...

  • Ah ifcpatch used to be a standalone .py file which symlinked in my /usr/local/bin to give that behaviour... now it's a module, so, uh :) Times change!

  • than there where just clouds in front of the forest :-) Again the sun is shining ... Got it. Thanks

    Moult
  • So i have a big IFC from Tekla which is too big and creating problems in Revit. @Moult thought that IfcPatch could be a solution since what I want to do is split the file so there is one file per building. It's a huge steel structure for two buildings in one file. Dion is rather busy at the moment @bernd do you have time to help me understand how to do something like this?

Sign In or Register to comment.